Object DispatcherProvider
-
- All Implemented Interfaces:
public class DispatcherProviderCoroutine dispatchers used internally by Stream libraries. Should always be used instead of directly using Dispatchers or creating new dispatchers.
-
-
Field Summary
Fields Modifier and Type Field Description private final CoroutineDispatcherMainprivate final CoroutineDispatcherImmediateprivate final CoroutineDispatcherIOpublic final static DispatcherProviderINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitset(CoroutineDispatcher mainDispatcher, CoroutineDispatcher ioDispatcher)Overrides the main (UI thread) and IO dispatcher. final Unitreset()Resets the dispatchers to their default values. final CoroutineDispatchergetMain()Represents the Main coroutine dispatcher, tied to the UI thread. final CoroutineDispatchergetImmediate()final CoroutineDispatchergetIO()Represents the IO coroutine dispatcher, which is usually tied to background work. -
-
Method Detail
-
set
final Unit set(CoroutineDispatcher mainDispatcher, CoroutineDispatcher ioDispatcher)
Overrides the main (UI thread) and IO dispatcher. For testing purposes only.
-
getMain
final CoroutineDispatcher getMain()
Represents the Main coroutine dispatcher, tied to the UI thread.
-
getImmediate
final CoroutineDispatcher getImmediate()
-
getIO
final CoroutineDispatcher getIO()
Represents the IO coroutine dispatcher, which is usually tied to background work.
-
-
-
-