Dedicated exceptions for read failures reduce the risk of mixing up "user" exceptions with those of Future itself. The risk still exists, if the user allows a chronos exception to bubble up explicitly.
Because await structurally guarantees that the Future is not pending at the time of read, it does not raise this new exception.
introduce FuturePendingError and FutureCompletedError when read:ing a future of uncertain state
introduce pollFor which finishes a Future without reading it, mirroring awaitne
fix waitFor / read to return lent values
simplify code generation for void-returning async procs
Dedicated exceptions for
read
failures reduce the risk of mixing up "user" exceptions with those of Future itself. The risk still exists, if the user allows a chronos exception to bubble up explicitly.Because
await
structurally guarantees that the Future is notpending
at the time ofread
, it does not raise this new exception.FuturePendingError
andFutureCompletedError
whenread
:ing a future of uncertain stateintroducepollFor
which finishes aFuture
without reading it, mirroringawaitne
waitFor
/read
to returnlent
valuesvoid
-returning async procsRaising
type helper