Skip to content

Ability to specify a limited dispatcher name #4023

Closed
@dovchinnikov

Description

@dovchinnikov

Use case

We have specific dispatchers, and in coroutine dumps they all look like LimitedDispatcher@xxxxxxxx, and it's not immediately clear where the dispatcher comes from.

The Shape of the API

Make kotlinx.coroutines.CoroutineDispatcher.limitedParallelism accept debugName: String?.

Alternatively, make an extension function fun CoroutineDispatcher.namedDispatcher(debugName: String): CoroutineDispatcher which will return a dispatcher, which delegates to this and has its toString overridden. It can return this as is when debug is off.

Prior Art

kotlinx.coroutines.scheduling.LimitingDispatcher has name.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions