3 ms·
Why would it need to be async for an already low latency mpmc queue?
by bfrog 3y ago
Why 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)