Futures 0.3: MPMC or SPMC support?


I run into this issue quite frequently, I usually have a single producer and multiple consumers, less frequently I need multiple producers and multiple consumers. I kind of need crossbeam-channels with futures 0.3 support.

Anyway I was wondering how projects that have been using futures 0.3 already e.g. Fuchsia deal with this?

An example for a use case for me would be a Websocket (Server) Stream that needs multiple consumers.

Looking forward to hear your answers!

Hi, and welcome to the forum. Sorry nobody got back to you earlier.

As far as I can tell, crossbeam does not have futures API yet, but it’s on @stjepang 's todo list.

It might be possible to do what you want with an LMAX Disruptor? Haven’t played around with them myself. The multiqueue crate implements this with futures support. It hasn’t been updated in 2 years, so it surely is for futures 0.1, but in my experience, the compatibility layer works quite well.

On the github repository I found that there is a fork which has been updated one month ago, so it might still be alive. Maybe get in touch with @abbychau if you can’t get it working or if it’s unclear where they are taking the project.

There are some more crates implementing disruptor, but I haven’t looked into them.