3 ms·
Because 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
by wongarsu 3y ago
Because 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)