withContext

suspend fun <T> withContext(lifetime: Lifetime, context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Deprecated

Consider overload without lifetime, if you need to limit lifetime of the scope use lifetimedCoroutineScope

Replace with

import kotlinx.coroutines.withContext
lifetimedCoroutineScope(lifetime) { withContext(context, block) }

suspend fun <T> withContext(scheduler: IScheduler, block: suspend CoroutineScope.() -> T): T

Deprecated

Use withRdSchedulerContext

Replace with

import com.jetbrains.rd.util.threading.coroutines.withRdSchedulerContext
withRdSchedulerContext(scheduler, block)

suspend fun <T> withContext(lifetime: Lifetime, scheduler: IScheduler, block: suspend CoroutineScope.() -> T): T

Deprecated

Consider using withRdSchedulerContext method, if you need to limit lifetime of the scope use lifetimedCoroutineScope

Replace with

import com.jetbrains.rd.util.threading.coroutines.withRdSchedulerContext
lifetimedCoroutineScope(lifetime) { withRdSchedulerContext(scheduler, block) }