We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb5415 commit 954503eCopy full SHA for 954503e
kotlinx-coroutines-core/common/src/NonCancellable.kt
@@ -18,6 +18,11 @@ import kotlin.coroutines.*
18
* // this code will not be cancelled
19
* }
20
* ```
21
+ *
22
+ * **WARNING**: This object is not designed to be used with [launch], [async], and other coroutine builders.
23
+ * if you write `launch(NonCancellable) { ... }` then not only the newly launched job will not be cancelled
24
+ * when the parent is cancelled, the whole parent-child relation between parent and child is severed.
25
+ * The parent will not wait for the child's completion, nor will be cancelled when the child crashed.
26
*/
27
public object NonCancellable : AbstractCoroutineContextElement(Job), Job {
28
/**
0 commit comments