DispatcherWithShutdown

class DispatcherWithShutdown(delegate: CoroutineDispatcher) : CoroutineDispatcher

Specialized dispatcher useful for graceful shutdown

Constructors

Link copied to clipboard
fun DispatcherWithShutdown(delegate: CoroutineDispatcher)

Functions

Link copied to clipboard
fun completeShutdown()

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

Link copied to clipboard
open override fun dispatch(context: CoroutineContext, block: Runnable)
Link copied to clipboard
open fun dispatchYield(context: CoroutineContext, block: Runnable)
Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun <T> interceptContinuation(continuation: Continuation<T>): Continuation<T>
Link copied to clipboard
open override fun isDispatchNeeded(context: CoroutineContext): Boolean
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
operator fun plus(other: CoroutineDispatcher): CoroutineDispatcher
Link copied to clipboard
fun prepareShutdown()

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

Link copied to clipboard
open override fun releaseInterceptedContinuation(continuation: Continuation<*>)
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val key: CoroutineContext.Key<*>