MainImmediateCoroutineScope

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

Factory function for a MainImmediateCoroutineScope with a DispatcherProvider. Dispatch defaults to the mainImmediate 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 MainImmediateCoroutineScope(coroutineContext: CoroutineContext): MainImmediateCoroutineScope

Factory function for a MainImmediateCoroutineScope with a DispatcherProvider. Dispatch defaults to the mainImmediate 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.