Felix
10/03/2018, 5:01 PMasync
, obtaining Deferred
objects
- Coroutine then cancels one of those Deferred
objects.
1) How can such a cancel
trigger a cancellation on the pending HTTP request? The Apache Async Client has a way to cancel requests, however since there isn't any thread actively monitoring the isActive
, I need to "link" the Deferred
cancel with the pending request cancel. For instance, in .NET the CancellationToken
as a Register
method to register an action to be performed.
2) Also, if the coroutine decides to ignore the cancellation (e.g. it is to late to cancel the HTTP request), how can we observe that on the Deferred
? What I'm observing is that the await
will throw the JobCancellationException
even if the cancel
is ignored.Felix
10/03/2018, 9:16 PMFelix
10/03/2018, 9:19 PMDeferred
, apparently it will transition immediately to a cancelled state, even if the cancellation is ignored by the underlying coroutine, right?Felix
10/03/2018, 9:21 PMDeferred
state depend on the coroutine reaction to the cancellation request?elizarov
10/04/2018, 5:33 AM