CoroutineDispatcherProvider

class CoroutineDispatcherProvider(val io: CoroutineDispatcher, val computation: CoroutineDispatcher, val ui: CoroutineDispatcher)

A wrapper class for common coroutine dispatchers. An instance of this can be injected to classes which are concerned about executing code on different threads, but they don't need to know about the underlying implementation. A single-threaded version for example can be injected for testing.

Constructors

Link copied to clipboard
fun CoroutineDispatcherProvider(io: CoroutineDispatcher, computation: CoroutineDispatcher, ui: CoroutineDispatcher)

Properties

Link copied to clipboard
val computation: CoroutineDispatcher

Dispatcher for computational work

Link copied to clipboard
val io: CoroutineDispatcher

Dispatcher for IO-bound work

Link copied to clipboard
val ui: CoroutineDispatcher

Dispatcher for UI work