Async-std: Any plan to port std::sync::mpsc or other channel types?

Created on 17 Aug 2019  路  5Comments  路  Source: async-rs/async-std

Hi,

I'm trying replacing tokio with async-std in my own project and it's truly amazing. However there's no channel-equivalents like std::sync::mpsc in async-std, so I have to use the futures crate's version.

I think it would be very nice to have mpsc, oneshot, etc. from futures crate re-exported in this crate's namespace for consistency and convenience. Any plan for that?

api design enhancement

Most helpful comment

I've started implementing an async version of crossbeam-channel, which will be separate from async-std, but belong in this Github organization.

All 5 comments

There is a plan! We're not quite sure though if we will ship it in this library or in a co-library. The channels module in libstd is widely considered a mistake, especially because there's reasons to use different channel implementations for different use-cases even in the same codebase.

I've started implementing an async version of crossbeam-channel, which will be separate from async-std, but belong in this Github organization.

The channels module in libstd is widely considered a mistake, especially because there's reasons to use different channel implementations for different use-cases even in the same codebase.

Just for future reference: some of the concerns and a possible way forward for the std channel are in @stjepang's blog post about that here: https://stjepang.github.io/2019/03/02/new-channels.html

Closing in favor of #212

There is now a channel implementation in the master branch of async-std, behind the unstable flag:
https://github.com/async-rs/async-std/pull/380

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zys864 picture zys864  路  4Comments

oblique picture oblique  路  5Comments

cole-acepph picture cole-acepph  路  5Comments

matthewrobertbell picture matthewrobertbell  路  7Comments

zkat picture zkat  路  6Comments