External Publication
Visit Post

Going from AsyncWrite to AsyncRead

Rust Internals [Unofficial] April 11, 2026
Source
It's certainly an interesting abstraction. I was going to say that we could add one to tokio-util, and that you could ask the futures-util maintainers about that too. But: Thinking a bit more about it, it does suffer one challenge, which is that when you stop reading, the internal future just stops running. If the internal future holds a mutex or semaphore or similar, then you could get a deadlock. That would be another instance of the classic FutureLock bug. I'm not sure I want to add any more abstractions with this problem. Spawning solves that problem, though.

Discussion in the ATmosphere

Loading comments...