withNamedContext

suspend fun <T> withNamedContext(name: String, block: suspend () -> T): T

Executes a given block of code within a coroutine context that has a specified name.

Return

The result of the block execution.

Parameters

name

The name to be assigned to the coroutine context.

block

The block of code to be executed within the named context.