Last active
August 29, 2015 13:56
-
-
Save benfoxall/8918328 to your computer and use it in GitHub Desktop.
PubNub backfill issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubnub = PUBNUB.init({ | |
publish_key : 'pub-c-your-key', | |
subscribe_key : 'sub-c-your-key', | |
}); | |
/*---- setup - paste in console a few times to put some messages in A */ | |
pubnub.publish({ | |
channel:'A', | |
message:'testing-' + Math.random() | |
}) | |
/*---- 1. subscribing to 'A' with backfill works */ | |
pubnub.subscribe({ | |
channel:'A', | |
callback: function(m){console.log("A>",m)}, | |
backfill:true | |
}) | |
/*---- 2. subscribing to 'A' with backfill, then 'B' without fails (cancelled xhr in console) */ | |
pubnub.subscribe({ | |
channel:'A', | |
callback: function(m){console.log("A>",m)}, | |
backfill:true | |
}) | |
pubnub.subscribe({ | |
channel:'B', | |
callback: function(m){console.log("B>",m)}, | |
backfill:false | |
}) |
Hi @benfoxall What is the issue, it looks like it is working very well! 👍 You've got two subscribes with channel "A"
which is okay. By subscribing to channel "B"
you are invoking the SDK to shutdown the TCP socket and open a new one for channels "A" + "B"
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(note, I'm using multiplexed channels)