-
Notifications
You must be signed in to change notification settings - Fork 502
Description
I suppose I'm reopening an issue on the archived dedicated channels repo (otherwise I'd just make a comment).
@stjepang mentioned here that it would be easier to reimplement channels from scratch with Future
support in mind ahead of time than to add Future
support to the extant library.
I have two questions:
- Is this on any public roadmap? I don't know nearly enough about async at the moment in Rust to valuably contribute, I don't believe.
- If one were to implement a
Stream
naiively using a crossbeam channel, would it not be efficient? I see an implementation exists as a benchmark, at least for some usages of the channel.
The primary reason I ask this for my own needs is that there appear to be no stable, working MPMC channels that also implement Stream
. My application essentially wants a stream of events that occur at a rate of approximately 5 events per millisecond with a couple dozen listeners to that same stream of events. I've created a mini benchmark (not good; no need to share in my opinion but if anyone is curious I can make it public) for using a bunch of futures::sync::mpsc::channel
s, one for each listener, and publishing on each of those Sender
s. It seems, given the benchmarks, that that might actually not be terribly inefficient (I can add 100 listeners then publish 10 messages per millisecond for 10 milliseconds in about 12 ms), but I'd rather do things the right way with a Receiver: Clone + Stream
, if I can.