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
See #481 for original motivation. Now, with introduction of CompletableJob (#607) we need to complete the process of Job.cancel(cause) removal, however, it poses the following challenges:
It is used in all integrations based on AbstractCoroutine (CompletableFuture, ListenableFuture, Rx integrations) to exceptionally terminate AbstractCoroutine on the failure of the primitive that integration is performed with either directly by calling cancel(cause) or via an internal function handleCoroutineException.
Deferred.asCompletableFuture() uses it for a two-way cancellation integration:
Job/ReceiveChannel/BroadcastChannel.cancel(Throwable) is now hidden and
cannot be invoked from a newly compiled code. This function had broken
semantics when used with an arbitrary exception. A safe replacement
is available in the form of cancel(CancellationException) where
CancellationException can be used to supply additional information
for debugging purposes.
Fixes#975
After some prototype, I'm leaving cancel(cause: CancellationException? = null) function. This way, you can still add additional details as a cancellation cause, but now it is clear that it is going to be a CancellationException and you cannot cause the coroutine you don't control to fail.
See #481 for original motivation. Now, with introduction of
CompletableJob
(#607) we need to complete the process ofJob.cancel(cause)
removal, however, it poses the following challenges:It is used in all integrations based on
AbstractCoroutine
(CompletableFuture
,ListenableFuture
, Rx integrations) to exceptionally terminateAbstractCoroutine
on the failure of the primitive that integration is performed with either directly by callingcancel(cause)
or via an internal functionhandleCoroutineException
.Deferred.asCompletableFuture()
uses it for a two-way cancellation integration:The text was updated successfully, but these errors were encountered: