Skip to content

Consider deprecation cycle for CoroutineDispatcher.invoke #4199

Open
@JakeWharton

Description

@JakeWharton

CoroutineDispatcher.invoke, a function used as such:

Dispatchers.IO {
  stuff
}

is a shorter version of withContext that only works with dispatchers.

Does this function need to exist? It seems to predate structured concurrency and is so terse that it offers no indication as to its underlying behavior. Does it launch a new coroutine? Does it move the current coroutine? Does the supplied block honor structured concurrency?

I personally have a hard time finding a reason for this function to continue to exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions