3 ms·
In Rust I get two nice things: • Instant, reliable cancellation. I can drop a Future at any time, and it won't do any more work, and cleans everything up. Raci
by pornel 6y ago
In Rust I get two nice things:
• Instant, reliable cancellation. I can drop a Future at any time, and it won't do any more work, and cleans everything up. Racing multiple things is easy.
• Ability to mix network-bound and CPU-bound tasks, and have both resources fully utilized at the same time. With threads if I sized threadpool for CPU cores, it'd be underutilizing CPU when doing I/O. If I sized it for connections, it'd hammer the CPU. An async scheduler has CPU threadpool + any number of connections it wants.