public class ThreadPoolDispatcherKt
| Modifier and Type | Method and Description |
|---|---|
static ExecutorCoroutineDispatcher |
newFixedThreadPoolContext(int nThreads,
java.lang.String name)
Creates new coroutine execution context with the fixed-size thread-pool and built-in
YieldKt.yield support.
NOTE: The resulting class ExecutorCoroutineDispatcher owns native resources (its threads).Resources are reclaimed by ExecutorCoroutineDispatcher.close. |
static ExecutorCoroutineDispatcher |
newSingleThreadContext(java.lang.String name)
Creates a new coroutine execution context using a single thread with built-in
YieldKt.yield support.
NOTE: The resulting class ExecutorCoroutineDispatcher owns native resources (its thread).Resources are reclaimed by ExecutorCoroutineDispatcher.close. |
public static ExecutorCoroutineDispatcher newSingleThreadContext(java.lang.String name)
Creates a new coroutine execution context using a single thread with built-in YieldKt.yield support.
NOTE: The resulting class ExecutorCoroutineDispatcher owns native resources (its thread).Resources are reclaimed by ExecutorCoroutineDispatcher.close.
name - the base name of the created thread.YieldKt.yield,
class ExecutorCoroutineDispatcher,
ExecutorCoroutineDispatcher.closepublic static ExecutorCoroutineDispatcher newFixedThreadPoolContext(int nThreads, java.lang.String name)
Creates new coroutine execution context with the fixed-size thread-pool and built-in YieldKt.yield support.
NOTE: The resulting class ExecutorCoroutineDispatcher owns native resources (its threads).Resources are reclaimed by ExecutorCoroutineDispatcher.close.
nThreads - the number of threads.name - the base name of the created threads.YieldKt.yield,
class ExecutorCoroutineDispatcher,
ExecutorCoroutineDispatcher.close