Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non cancellable docs #2633

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions kotlinx-coroutines-core/common/src/NonCancellable.kt
Expand Up @@ -18,6 +18,11 @@ import kotlin.coroutines.*
* // this code will not be cancelled
* }
* ```
*
* **WARNING**: This object is not designed to be used with [launch], [async], and other coroutine builders.
* if you write `launch(NonCancellable) { ... }` then not only the newly launched job will not be cancelled
* when the parent is cancelled, the whole parent-child relation between parent and child is severed.
* The parent will not wait for the child's completion, nor will be cancelled when the child crashed.
*/
public object NonCancellable : AbstractCoroutineContextElement(Job), Job {
/**
Expand Down