Closed herzi closed 10 years ago
These arguments are undocumented because they are for "private" use. Only the JavaScript SDK exposes this data to user code. Other SDKs like Python do not, so documenting it would not be helpful in the "grand scheme".
What you are calling bucket
is the full subscription envelope received from the server (before it is parsed by the client SDK). And the someNumber
is a calculation of network jitter; effectively the latency between when a message was published, and when you received it.
:+1: @parasyte
Would it make sense to remove the other three arguments soon? (Before someone starts relying on those.)
These arguments will always be supported for the version of that SDK. New arguments are on the way with our Subscribe V2 coming out. Everything will always be backwards compatible.
A your API reference at https://www.pubnub.com/docs/javascript/api/reference.html#subscribe does not describe the arguments being passed to the callbacks, I started to add code like this to my callback method:
And thus, I realized that your small examples only care about the first first argument for the
callback
parameter:message
.The other three arguments are not documented.
Here are my conclusions, please verify and update the API reference:
message
, just as described in the documentationbucket
, this looks like an array of currently received messages, put into an array along with a timestamp:[ [ message ], timestamp ]
(with message being the first argument to the callbackchannelID
, the ID of the channel that was subscribed tosomeNumber
, a floating point number (I have no clue what this is)