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
Introduce CancellableContinuation.resume with onCancelling lambda
* Allows safe return of closeable resources from suspending
functions, as it provides a way to close a resource if the
corresponding job was cancelled.
* Documentation on the context and expected behavior of
CompletionHandler implementations is updated.
Fixes#1044
Copy file name to clipboardExpand all lines: binary-compatibility-validator/reference-public-api/kotlinx-coroutines-core.txt
+3
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ public abstract interface class kotlinx/coroutines/CancellableContinuation : kot
40
40
public abstract fun isActive ()Z
41
41
public abstract fun isCancelled ()Z
42
42
public abstract fun isCompleted ()Z
43
+
public abstract fun resume (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V
43
44
public abstract fun resumeUndispatched (Lkotlinx/coroutines/CoroutineDispatcher;Ljava/lang/Object;)V
44
45
public abstract fun resumeUndispatchedWithException (Lkotlinx/coroutines/CoroutineDispatcher;Ljava/lang/Throwable;)V
45
46
public abstract fun tryResume (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
@@ -54,6 +55,7 @@ public final class kotlinx/coroutines/CancellableContinuation$DefaultImpls {
54
55
public class kotlinx/coroutines/CancellableContinuationImpl : kotlin/coroutines/jvm/internal/CoroutineStackFrame, kotlinx/coroutines/CancellableContinuation {
55
56
public fun <init> (Lkotlin/coroutines/Continuation;I)V
56
57
public fun cancel (Ljava/lang/Throwable;)Z
58
+
public fun cancelResult (Ljava/lang/Object;Ljava/lang/Throwable;)V
57
59
public fun completeResume (Ljava/lang/Object;)V
58
60
public fun getCallerFrame ()Lkotlin/coroutines/jvm/internal/CoroutineStackFrame;
59
61
public fun getContext ()Lkotlin/coroutines/CoroutineContext;
@@ -68,6 +70,7 @@ public class kotlinx/coroutines/CancellableContinuationImpl : kotlin/coroutines/
68
70
public fun isCancelled ()Z
69
71
public fun isCompleted ()Z
70
72
protected fun nameString ()Ljava/lang/String;
73
+
public fun resume (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V
71
74
public fun resumeUndispatched (Lkotlinx/coroutines/CoroutineDispatcher;Ljava/lang/Object;)V
72
75
public fun resumeUndispatchedWithException (Lkotlinx/coroutines/CoroutineDispatcher;Ljava/lang/Throwable;)V
0 commit comments