Atmosphere/atmosphere — pull request #834 by bennyn (2013-01-18 17:49:17+00:00)
Title: Update modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js

Concept for a callback mechanism. Already works reliably for long polling. The callback is also executed when using WebSockets but there it is not reliable because it is not waiting for a successful response.

The callback concept looks like this:

var data = 'something';
var request = { ... };
var socket = $.atmosphere;
var subSocket = socket.subscribe(request);
var config = {
onSuccess: function(){
alert('Callback executed.');
}
};
subSocket.push(data, null ,config);

The concept refers to this request:
https://github.com/Atmosphere/atmosphere/issues/808

Hope it's useful!

Benny