3 ms·
This is very interesting: I have a bit of an aversion to implicit await, but guaranteed completion does make that slightly less bad in my mind. There are a few
by Diggsey 5y ago
This is very interesting: I have a bit of an aversion to implicit await, but guaranteed completion does make that slightly less bad in my mind.
There are a few things that I felt were a bit glossed over:
1) How exactly does an executor fullfill the contract of the new unsafe "poll" method? eg. what happens if there is a panic in one of the futures, or in the executor itself? Even if the executor catches the panic, what about the future that itself panicked - clearly that will not be polled to completion.
2) How does cancellation work exactly? You mentioned that somehow the underlying async operations return an "interrupted" error. Who controls cancellation of a future? (the executor?). How does that agent know which "leaf futures" need to be interrupted? How does it signal to those "leaf futures" that they should return immediately? Does this mean that all cancellable futures must return a `Result<T, impl From<InterruptedError>>`?
3) Do you think this change would help with problems like https://github.com/http-rs/async-h1/pull/179 https://github.com/http-rs/async-h1/pull/179 ?