5 ms·
Crossbeam isn't async[0]. It can multiplex with itself (via the `select!` macro), but not with anything else. [0]: https://github.com/crossbeam-rs/crossbeam/is
by Nullabillity 3y ago
Crossbeam isn't async[0]. It can multiplex with itself (via the `select!` macro), but not with anything else.
[0]: https://github.com/crossbeam-rs/crossbeam/issues/896 https://github.com/crossbeam-rs/crossbeam/issues/896
- jitl 3y agoGotcha, thanks.
- bfrog 3y agoWhy would it need to be async for an already low latency mpmc queue?
- cchance 3y agoI imagine for working with non-low latency producers or consumers, such as network requests?
- Nullabillity 3y agoThe queue itself may be fast, but that doesn't mean that the other end of your pipe is.
- wongarsu 3y agoBecause queues have blocking operations, like getting the next item when it's available, or putting in the next item as soon as there's space in a bounded queue. But if your code is async you can't block the whole thread, you want your queue to block in an async way (well, you could wrap all blocking calls in tokio::task::spawn_blocking, but that's not ergonomic)