You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to ListenableFutures returned from Deferred.asListenableFuture and CoroutineScope.future.
Currently we override AbstractFuture.cancel and call super.cancel() before cancelling the coroutine.
This means that if the future has a slow listener, it can delay cancellation of the coroutine.
AbsractFutureexplicitly recommendsafterDone for this use case. We can use it when the API is finalised (at this moment afterDone is annotated with @Beta).
However, one disadvantage of afterDone, is that we'll have to unconditionally check if the future isCancelled(), which will cost us a volatile read even in case when the future is completed successfully.
See #2222 for more info, it added two @Ignored tests related to this issue.
The text was updated successfully, but these errors were encountered:
This is related to
ListenableFutures
returned fromDeferred.asListenableFuture
andCoroutineScope.future
.Currently we override
AbstractFuture.cancel
and callsuper.cancel()
before cancelling the coroutine.This means that if the future has a slow listener, it can delay cancellation of the coroutine.
AbsractFuture
explicitly recommendsafterDone
for this use case. We can use it when the API is finalised (at this momentafterDone
is annotated with@Beta
).However, one disadvantage of
afterDone
, is that we'll have to unconditionally check if the futureisCancelled()
, which will cost us a volatile read even in case when the future is completed successfully.See #2222 for more info, it added two
@Ignore
d tests related to this issue.The text was updated successfully, but these errors were encountered: