core / pragma.jobs / BackgroundManager / useMyContext /

useMyContext #

abstract suspend fun useMyContext(block: suspend CoroutineScope.() -> Unit)

Runs the block of code on the kotlin.coroutines.CoroutineContext owned by this BackgroundManager.

Useful for Java callbacks because they usually come in on a different thread.

Parameters #

block

Block of code to be executed.