Skip to content

For each event add a client identification.#14

Open
cdupetit wants to merge 2 commits intowilk:masterfrom
cdupetit:addclient
Open

For each event add a client identification.#14
cdupetit wants to merge 2 commits intowilk:masterfrom
cdupetit:addclient

Conversation

@cdupetit
Copy link

When you use the $un function, it removes all the handlers registered on an event.
But if you want to remove just a particular handler on an event, you can't.
With this evolution when you register a handler, you can specify the associate client.
Example:
ws.$on({event: "$close", client: "client1"}, function() {} );
ws.$on({event: "$close", client: "client2"}, function() {} );
And when you want to unregister this handler, you can do the same.
ws.$un({event: "$close", client: "client1"});
The handler of "client2" is still working.

@LeleDev
Copy link

LeleDev commented Feb 13, 2015

+1 for the feature (didn't test the code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants