CoroutineName

data class CoroutineName : AbstractCoroutineContextElement (source)

Platform and version requirements: JVM

User-specified name of coroutine. This name is used in debugging mode. See newCoroutineContext for the description of coroutine debugging facilities.

Types

Key

companion object Key : Key<CoroutineName>

Key for CoroutineName instance in the coroutine context.

Constructors

<init>

CoroutineName(name: String)

User-specified name of coroutine. This name is used in debugging mode. See newCoroutineContext for the description of coroutine debugging facilities.

Properties

name

val name: String

User-defined coroutine name.

Functions

toString

fun toString(): String

Returns a string representation of the object.

Extension Functions

cancel

fun CoroutineContext.cancel(
    cause: Throwable? = null
): Boolean

Cancels Job of this context with an optional cancellation cause. The result is true if the job was cancelled as a result of this invocation and false if there is no job in the context or if it was already cancelled or completed. See Job.cancel for details.

cancelChildren

fun CoroutineContext.cancelChildren(
    cause: Throwable? = null
): Unit

Cancels all children of the Job in this context with an optional cancellation cause. It does not do anything if there is no job in the context or it has no children. See Job.cancelChildren for details.