Skip to content

Instantly share code, notes, and snippets.

@af2905
Created November 11, 2023 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save af2905/0ab381ce8c3f500febe25078f2487f0a to your computer and use it in GitHub Desktop.
Save af2905/0ab381ce8c3f500febe25078f2487f0a to your computer and use it in GitHub Desktop.
coroutine_start
package kotlinx.coroutines
public enum class CoroutineStart {
@InternalCoroutinesApi
public operator fun <T> invoke(block: suspend () -> T, completion: Continuation<T>): Unit =
when (this) {
DEFAULT -> block.startCoroutineCancellable(completion)
ATOMIC -> block.startCoroutine(completion)
UNDISPATCHED -> block.startCoroutineUndispatched(completion)
LAZY -> Unit // will start lazily
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment