Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom data when returning a list of all socket clients #154

Closed
wants to merge 2 commits into from

Conversation

connected-yzhang
Copy link

We have a use case when a new client connects to a socket.io server, it would like to know all the clients that are in a particular room, and some metadata of the clients on the other side. So we implemented a custom hook function that enables the consumer of the 'clients' call on the adapter to implement custom callback to fetch client metadata in addition to the clientIDs.

@darrachequesne
Copy link
Member

Hi! Could you please rebase against master (most notably after #146)?

How about adding a new requestType?

var requestTypes = {
 clients: 0,
 clientRooms: 1,
 allRooms: 2, // list of all rooms created on every node
 remoteJoin: 3, // make any socket.id join a given room
 remoteLeave: 4, // make any socket.id leave a given room
 customRequest: 5, // using your registered hook
};

@connected-yzhang
Copy link
Author

@darrachequesne Hi thanks for the quick look-at. We're just trying to initiate a discussion to see if this is a change that you think is worth making, has a reasonable demand and is inline with where you envisioned the socket.io-redis adapter to go. If so, we're more than happy to rebase against the current master.

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.

None yet

2 participants