CoroutineScope

fun CoroutineScope(context: CoroutineContext): CoroutineScope

Creates a CoroutineScope that wraps the given coroutine context.

If the given context does not contain a Job element, then a default Job() is created. This way, failure of any child coroutine in this scope or cancellation of the scope itself cancels all the scope's children, just like inside coroutineScope block.

Sources

common source
Link copied to clipboard