-
Notifications
You must be signed in to change notification settings - Fork 6
frequency and sessions
Due to how the APE Server works and to take sessions support to the next level, the ApePubSub framework has recently been updated to implement frequency. If you have use the official APE_JSF you should be familiar with it. It basically changes the the server hostname on every page load. For example if server is ape.ptejada.com
it will become:
1.ape.ptejada.com
2.ape.ptejada.com
3.ape.ptejada.com
4.ape.ptejada.com
...
59.ape.ptejada.com
...
75.ape.ptejada.com
...
An extra step in the installation proccess is required to add the domain name wildcard *.ape.ptejada.com
. The wiki should be update soon to add the extra step. Note that if you don't use sessions
this changes will not apply, no frequency will be added to requests so the server address will always be ape.ptejada.com
.
A new feature that the improved session support brings is call sync. sync is implemented as a simple paramater. It is used to keep many intances of a client under the same session syncronised. It basically allows a user to publish a message/data and allows the sender to recieve his own message in the current window and any other window in the same session. To visually test this feature open two tabs of any demo, send multiple messages on one tab and the other tab should reflect the messages that you just sent.
This is also been intgrated with the eventPush feature. So now you are able to route your messages to a PHP script, parsed the messages, change it or whatever and then get back the updated messages as it is published. Test it here
For the ultimate visual example open this demo in one tab and this other demo in another tab. You should be same user in both. They both subscribe to the same channel, one publishes directly to the APE Server and the other is routed via a PHP script. Both tabs should mirror the same info, messages sent.
The wiki should be updated soon to reflect the API changes
The old scheme looked client.pub( channel_name , message , callback)
The new scheme looks client.pub( channel_name , message , sync , callback)
where sync is a boolean which if true will sync the message accross the user session.