namedDefaultScope

fun namedDefaultScope(name: String, corePoolSize: Int, job: Job? = null, errorHandler: CoroutineExceptionHandler? = null, context: CoroutineContext = EmptyCoroutineContext): CoroutineScope(source)

Creates a CoroutineScope with incremental thread naming, uses getDefaultScope under the hood.

Parameters

name

The base name of the threads and coroutines, will be prefixed by the number if corePoolSize 1

corePoolSize

The number of threads to keep in the pool, even if they are idle

job

The parent job used for coroutines which can be used to cancel all children, uses SupervisorJob by default

errorHandler

The CoroutineExceptionHandler used for handling uncaught exceptions, uses a logging handler which cancels the parent job on Error by default

context

Any additional context to add to the scope, uses EmptyCoroutineContext by default


fun namedDefaultScope(coroutineName: String, executor: Executor, job: Job? = null, errorHandler: CoroutineExceptionHandler? = null, context: CoroutineContext = EmptyCoroutineContext): CoroutineScope(source)

Creates a CoroutineScope with incremental thread naming, uses getDefaultScope under the hood.

Parameters

coroutineName

The name of the coroutines

executor

The executor running the coroutines

job

The parent job used for coroutines which can be used to cancel all children, uses SupervisorJob by default

errorHandler

The CoroutineExceptionHandler used for handling uncaught exceptions, uses a logging handler which cancels the parent job on Error by default

context

Any additional context to add to the scope, uses EmptyCoroutineContext by default