Move onReady callback to after channel response from server, so we have a client_id before we start sending other RPCs.

This commit is contained in:
Ian Gulliver
2014-05-14 23:28:56 +03:00
parent 3a3cba9be3
commit 1e755c9693
3 changed files with 37 additions and 23 deletions

View File

@@ -54,23 +54,17 @@ asyncTest('Message round trip', function() {
var subject = randstring();
var message = randstring();
console.log('subject:', subject);
console.log('message:', message);
var callbacks1 = {
'onReady': function() {
console.log('onReady 1');
cosmo1.sendMessage(subject, message);
},
};
var callbacks2 = {
'onReady': function() {
console.log('onReady 2');
cosmo2.subscribe(subject, -1);
},
'onMessage': function(e) {
console.log('onMessage');
equal(e['subject'], subject, 'subject matches');
equal(e['message'], message, 'message matches');
cosmo1.shutdown();