AsyncThreadDispatcher

class AsyncThreadDispatcher(val executor: AsyncExecutor, val threads: Int = -1) : CoroutineDispatcher, KtDispatcher, Disposable

A CoroutineDispatcher that wraps around an AsyncExecutor instance (executor) to execute tasks asynchronously.

Requires calling executePending in order to support delay.

Constructors

Link copied to clipboard
fun AsyncThreadDispatcher(executor: AsyncExecutor, threads: Int = -1)

Functions

Link copied to clipboard
open suspend fun delay(time: Long)
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 dispose()
Link copied to clipboard
open override fun execute(block: Runnable)

Immediately executes the passed block.

Link copied to clipboard

Executes any pending timed (delay) or queued (queue) tasks.

Link copied to clipboard
abstract fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
abstract operator fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
Link copied to clipboard
open override fun invokeOnTimeout(timeMillis: Long, block: Runnable, context: CoroutineContext): DisposableHandle
Link copied to clipboard
Link copied to clipboard
open fun limitedParallelism(parallelism: Int): CoroutineDispatcher
Link copied to clipboard
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
operator fun plus(other: CoroutineDispatcher): CoroutineDispatcher
Link copied to clipboard
open override fun queue(block: Runnable)

Schedules the execution of the passed block.

Link copied to clipboard
Link copied to clipboard
open override fun scheduleResumeAfterDelay(timeMillis: Long, continuation: CancellableContinuation<Unit>)
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
Link copied to clipboard