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

feat: broadcast to only selected client #458

Closed
Anas35 opened this issue Dec 22, 2022 · 8 comments
Closed

feat: broadcast to only selected client #458

Anas35 opened this issue Dec 22, 2022 · 8 comments
Assignees

Comments

@Anas35
Copy link

Anas35 commented Dec 22, 2022

Description

Are there a way to group a selected client and broadcast only within that group ? Client that are not in the group should no listen to the message.

socket.io JS packages uses join() and to() to broadcast within a group.

@felangel
Copy link
Contributor

To broadcast to a specific client you can just add the message to the specific client’s sink. Regarding groups, that is something that you would have to implement currently.

@felangel felangel added question waiting for response Waiting for follow up labels Dec 22, 2022
@felangel felangel self-assigned this Dec 22, 2022
@Anas35
Copy link
Author

Anas35 commented Dec 22, 2022

thanks! I implemented the groups by storing the client's sink to its corresponding group id's in a map. May be, Groups feature is more suitable for broadcast_bloc?

@felangel
Copy link
Contributor

thanks! I implemented the groups by storing the client's sink to its corresponding group id's in a map. May be, Groups feature is more suitable for broadcast_bloc?

No problem!
Yup, I think it would be great to move this conversation to the broadcast_bloc repository since it more directly pertains to that package, thanks!

@Anas35
Copy link
Author

Anas35 commented Dec 23, 2022

Sure, Can you transfer this issue to the broadcast_bloc repository or do we have to create a new issue in that repository?

@felangel
Copy link
Contributor

Unfortunately, I can't transfer the issue because the broadcast_bloc repository isn't part of the same GitHub organization.

@Anas35
Copy link
Author

Anas35 commented Dec 23, 2022

closing on felangel/broadcast_bloc#2

@Anas35 Anas35 closed this as completed Dec 23, 2022
@aytunch
Copy link

aytunch commented Jan 15, 2023

To broadcast to a specific client you can just add the message to the specific client’s sink. Regarding groups, that is something that you would have to implement currently.

@felangel how do we add a message to a specific client's sink? Do we have a pointer to each connected client? Which variable holds this info? thanks

@felangel
Copy link
Contributor

@aytunch each time a new client connects you get a channel object which corresponds to the client and allows you to send/received messages with that specific client. Hope that helps 👍

@felangel felangel removed the waiting for response Waiting for follow up label Jan 15, 2023
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

No branches or pull requests

3 participants