You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if I can register on a stream to get notified after a client has established a connection to the server.
In my current project I need this to initialize a context object for each client on the server. Hence, I have to check in every listening (server) method if such a context is already available. In case not, a new context object is created.
The text was updated successfully, but these errors were encountered:
Meteor.onConnection(function(connection) {}) could be used here as meteor-streams are using Meteor 'connection'.
However here you will face the problem this Meteor.onConnection happens earlier than client streams starts listen for the events (in other words does https://github.com/arunoda/meteor-streams/blob/master/lib/client.js#L33), so you need to modify https://github.com/arunoda/meteor-streams/blob/master/lib/server.js#L38 adding hook at the end of the publish method, something like
self.onConnected && self.onConnected(subscriptionId);
Then your code could look like:
It would be nice if I can register on a stream to get notified after a client has established a connection to the server.
In my current project I need this to initialize a context object for each client on the server. Hence, I have to check in every listening (server) method if such a context is already available. In case not, a new context object is created.
The text was updated successfully, but these errors were encountered: