flume icon indicating copy to clipboard operation
flume copied to clipboard

Please support creating a Receiver from a Sender and vice versa

Open joshtriplett opened this issue 1 year ago • 1 comments

Receiver and Sender both contain the same Shared structure. I'd love to have a Sender::make_receiver function that produces a Receiver from a Sender (and vice versa with Receiver::make_sender), to allow storing only one in a data structure rather than storing the pair.

For precedent, see https://docs.rs/tokio/latest/tokio/sync/watch/struct.Sender.html#method.subscribe .

joshtriplett avatar Oct 10 '24 22:10 joshtriplett

That sounds like a reasonable suggestion. I'm very happy to accept a PR. Alternatively, I'll get round to it when I can find the time.

zesterer avatar Oct 15 '24 15:10 zesterer