Package dispatch.core
Types
Marker interface which designates a CoroutineScope with a CoroutineDispatcher of default
.
Holder singleton for a DispatcherProvider instance.
Interface corresponding to the different CoroutineDispatcher's offered by Dispatchers.
Marker interface which designates a CoroutineScope with a CoroutineDispatcher of io
.
Marker interface which designates a CoroutineScope with a CoroutineDispatcher of main
.
Marker interface which designates a CoroutineScope with a CoroutineDispatcher of mainImmediate
.
Marker interface which designates a CoroutineScope with a CoroutineDispatcher of unconfined
.
Functions
Creates a coroutine and returns its future result as an implementation of Deferred.
Creates a coroutine and returns its future result as an implementation of Deferred.
Creates a coroutine and returns its future result as an implementation of Deferred.
Creates a coroutine and returns its future result as an implementation of Deferred.
Creates a coroutine and returns its future result as an implementation of Deferred.
Factory function for a DefaultCoroutineScope with a DispatcherProvider. Dispatch defaults to the default
property of the DispatcherProvider
.
Default implementation of DispatcherProvider which simply delegates to the corresponding properties in the Dispatchers singleton.
Extracts the DispatcherProvider from the coroutineContext
of the collector coroutine, then uses its DispatcherProvider.default property to call flowOn(theDispatcher)
, and returns the result.
Extracts the DispatcherProvider from the coroutineContext
of the collector coroutine, then uses its DispatcherProvider.io property to call flowOn(theDispatcher)
, and returns the result.
Extracts the DispatcherProvider from the coroutineContext
of the collector coroutine, then uses its DispatcherProvider.main property to call flowOn(theDispatcher)
, and returns the result.
Extracts the DispatcherProvider from the coroutineContext
of the collector coroutine, then uses its DispatcherProvider.mainImmediate property to call flowOn(theDispatcher)
, and returns the result.
Extracts the DispatcherProvider from the coroutineContext
of the collector coroutine, then uses its DispatcherProvider.unconfined property to call flowOn(theDispatcher)
, and returns the result.
Factory function for a IOCoroutineScope with a DispatcherProvider. Dispatch defaults to the io
property of the DispatcherProvider
.
Factory function for an IOCoroutineScope with a DispatcherProvider. Dispatch defaults to the io
property of the DispatcherProvider
.
Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is cancelled.
Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is cancelled.
Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is cancelled.
Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is cancelled.
Launches a new coroutine without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is cancelled.
Factory function for a MainCoroutineScope with a DispatcherProvider. Dispatch defaults to the main
property of the DispatcherProvider
.
Factory function for a MainImmediateCoroutineScope with a DispatcherProvider. Dispatch defaults to the mainImmediate
property of the DispatcherProvider
.
Factory function for a UnconfinedCoroutineScope with a DispatcherProvider. Dispatch defaults to the unconfined
property of the DispatcherProvider
.
Calls the specified suspending block with a given coroutine context, suspends until it completes, and returns the result.
Calls the specified suspending block with a given coroutine context, suspends until it completes, and returns the result.
Calls the specified suspending block with a given coroutine context, suspends until it completes, and returns the result.
Properties
Extracts the defaultCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.
Extracts the DispatcherProvider out of the CoroutineScope, or returns a new instance of DefaultDispatcherProvider.get if the coroutineContext
does not have one specified.
Extracts the DispatcherProvider out of the CoroutineContext, or returns a default from DefaultDispatcherProvider.get if the CoroutineContext
does not have one specified.
Extracts the ioCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.
Extracts the mainCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.
Extracts the mainImmediateCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.
Extracts the unconfinedCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.