If your you underlying mechanism supports request ...
# coroutines
e
If your you underlying mechanism supports request cancellation, then you should use
suspendCancellableCoroutine
. It is a drop-in replacement for
suspendCoroutine
that lets you make supension cancellable. See how
CompeltableFuture.await
is implemented, for example, or
rx.Single.await
.
👍 1