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

TeeingReceive{Stream,Channel} and receive_{stream,channel}_from – relevant for this repo? #3

Open
ntninja opened this issue Feb 1, 2020 · 2 comments

Comments

@ntninja
Copy link

ntninja commented Feb 1, 2020

As part of my work on ipfs/py-datastore I ended up creating two generic utilities that may be useful in the context of this repository as well:

  • TeeingReceive{Stream,Channel}: Wraps an existing trio.Receive{Stream,Channel} and forwards all data received by the wrapped source to an arbitrary number of additional Receive* consumers using an in-memory channel for each.
  • receive_{stream,channel}_from: Creates a trio.ReceiveStream from an arbitrary Python/bytes object, iterable or async iterable (returning trio.ReceiveStreams unchanged of course)

Do these sound appropriate for inclusion into this library?

@belm0
Copy link
Contributor

belm0 commented Feb 2, 2020

Happy to consider them. Is the implementation in a public repo already by any chance?

I don't have a sense for how general of a need these fill.

@ntninja ntninja changed the title TeeReceive{Stream,Channel} and receive_{stream,channel}_from – relevant for this repo? TeeingReceive{Stream,Channel} and receive_{stream,channel}_from – relevant for this repo? Feb 2, 2020
@ntninja
Copy link
Author

ntninja commented Feb 2, 2020

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