threadPoolDispatcher

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

NOTE: The resulting CloseableCoroutineDispatcher owns native resources (its thread). Resources are reclaimed by CloseableCoroutineDispatcher.close.

expect fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

NOTE: The resulting CloseableCoroutineDispatcher owns native resources (its thread). Resources are reclaimed by CloseableCoroutineDispatcher.close.

Parameters

numberOfThreads

The number of the threads that the thread pool should consist of.

name

The name of the thread pool to be created.

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool. Since JavaScript does not have threading support, this will just return Dispatchers.Default

Parameters

numberOfThreads

The number of the threads that the thread pool should consist of.

name

The name of the thread pool to be created.

actual fun threadPoolDispatcher(numberOfThreads: UInt, name: String): CloseableCoroutineDispatcher

Creates a coroutine execution context using a thread pool.

NOTE: The resulting CloseableCoroutineDispatcher owns native resources (its thread). Resources are reclaimed by CloseableCoroutineDispatcher.close.