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

Variable receivers count #791

Open
tucksaun opened this issue Apr 17, 2023 · 2 comments
Open

Variable receivers count #791

tucksaun opened this issue Apr 17, 2023 · 2 comments

Comments

@tucksaun
Copy link

Hi there!

Thank you for this nice tool!
I see how it can be handy for connecting decoupled or closed ecosystems.

While I was imagining this tool used to push some webhooks info to CD pipelines I wondered how easy it would be to have a variable number of receivers.
I'm not talking about allowing new receivers once the sender started to send but only allowing new receivers while the sender didn't connect it and then making it send right away in that particular case.
I tried to hack it and it seems this is not quite complicated. would you be open to having a PR to support this?

@tucksaun
Copy link
Author

Actually, after trying to add another feature that could be useful for my use case I figured it would probably make more sense to just merge the two as one: add a no-wait feature for the sender.
By doing so we can have a sender send it as soon as it's ready if this is what is decided, whatever the current receiver count is, allowing not to block waiting for a receiver that is not coming.
what do you think?

if the idea sounds okay to you then I can quickly submit a PR :)

@edward93
Copy link

edward93 commented Sep 8, 2023

I was thinking about something similar too, setup that mimics publisher/subscriber tech!

  • Sender POSTS ReadableStream
  • Receiver 1 GETS the stream and tries to decode it, if they are lucky to catch all chunks they can decode the data
  • Receiver 2 GETS the stream and tries to do the same thing!

At any point any receiver can join/leave

This way you can have one to many chat with variable number of receivers!

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

2 participants