We have a web calendar client which shows events in real time. Whenever there is an update on the server, we use Ably Realtime to notify the client that it needs to request updates from the server. The client then uses an Ajax call to get the updated info from the server.
The problem is that there are multiple updates happening and sometimes a new Ajax call is started before the old one is completed. The problem is how do we get the 2nd Ajax call to execute only after the first one completes.
Example code:
channel.subscribe(function(message) { $.ajax({...}) });