public class ExecutorCoroutineDispatcher
extends CoroutineDispatcher
class CoroutineDispatcher that has underlying Executor for dispatching tasks.
Instances of class ExecutorCoroutineDispatcher should be closed by the owner of the dispatcher.
This class is generally used as a bridge between coroutine-based API and asynchronous API which requires instance of the Executor.
| Constructor and Description |
|---|
ExecutorCoroutineDispatcher()
class CoroutineDispatcher that has underlying Executor for dispatching tasks.
Instances of class ExecutorCoroutineDispatcher should be closed by the owner of the dispatcher. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this coroutine dispatcher and shuts down its executor.
|
java.util.concurrent.Executor |
getExecutor()
Underlying executor of current
class CoroutineDispatcher. |
dispatch, interceptContinuation, isDispatchNeededpublic ExecutorCoroutineDispatcher()
class CoroutineDispatcher that has underlying Executor for dispatching tasks.
Instances of class ExecutorCoroutineDispatcher should be closed by the owner of the dispatcher.
This class is generally used as a bridge between coroutine-based API and asynchronous API which requires instance of the Executor.
public void close()
Closes this coroutine dispatcher and shuts down its executor.
It may throw an exception if this dispatcher is global and cannot be closed.
public java.util.concurrent.Executor getExecutor()
Underlying executor of current class CoroutineDispatcher.
class CoroutineDispatcher