rexxars / sse-channel

Server-Sent Events "channel" where all messages are broadcasted to all connected clients, history is maintained automatically and server attempts to keep clients alive by sending "keep-alive" packets automatically.
MIT License
111 stars 11 forks source link

Get connections method #17

Closed oferitz closed 7 years ago

oferitz commented 7 years ago

Hi,

I Would like to add a new method for the channel API that will get all current connections of a channel.

The motivation to do that comes from a use case which i need to send a message to specific clients channel.send allows me to do that by sending an array of clients but how to i get this array? it seems like i need to manage it by myself by adding and removing clients with the help of connect and disconnect events, do my filtering logic and then pass this array of clients to the send method. am i missing something here?

EDIT: i figured it out. i missed the fact that i can access the connections property of a channel directly which is what i was looking for. this issue can be closed