MainCoroutineScope

fun MainCoroutineScope(job: Job = SupervisorJob(), dispatcherProvider: DispatcherProvider = DefaultDispatcherProvider.get()): MainCoroutineScope

Factory function for a MainCoroutineScope with a DispatcherProvider. Dispatch defaults to the main property of the DispatcherProvider.

See also

kotlinx.coroutines.CoroutineScope

Parameters

job

Job to be used for the resulting CoroutineScope. Uses a SupervisorJob if one is not provided.

dispatcherProvider

DispatcherProvider to be used for the resulting CoroutineScope. Uses DefaultDispatcherProvider.get if one is not provided.


fun MainCoroutineScope(coroutineContext: CoroutineContext): MainCoroutineScope

Factory function for a MainCoroutineScope with a DispatcherProvider. Dispatch defaults to the main property of the DispatcherProvider.

See also

kotlinx.coroutines.CoroutineScope

Parameters

coroutineContext

CoroutineContext to be used for the resulting CoroutineScope. Any existing ContinuationInterceptor will be overwritten. If the CoroutineContext does not already contain a DispatcherProvider, DefaultDispatcherProvider.get will be added.