DispatcherWithShutdown

class DispatcherWithShutdown : CoroutineDispatcher

Specialized dispatcher useful for graceful shutdown

Constructors

<init>

DispatcherWithShutdown(delegate: CoroutineDispatcher)

Specialized dispatcher useful for graceful shutdown

Functions

completeShutdown

fun completeShutdown(): Unit

Complete shutdown. Any further attempts to dispatch anything will fail with RejectedExecutionException

dispatch

fun dispatch(context: <ERROR CLASS>, block: Runnable): Unit

isDispatchNeeded

fun isDispatchNeeded(context: <ERROR CLASS>): Boolean

prepareShutdown

fun prepareShutdown(): Unit

Prepare for shutdown so we will not dispatch on delegate anymore. It is still possible to dispatch coroutines.