Package com.jetbrains.rd.util.threading.coroutines

Types

Link copied to clipboard
open class RdCoroutineScope : CoroutineScope

Functions

Link copied to clipboard
fun <T> ISource<T>.adviseSuspend(    lifetime: Lifetime,     scheduler: IScheduler,     handler: suspend (T) -> Unit)
fun <T> ISource<T>.adviseSuspend(    lifetime: Lifetime,     context: CoroutineContext,     handler: suspend (T) -> Unit)
Link copied to clipboard
fun IScheduler.asCoroutineDispatcher(allowInlining: Boolean): CoroutineDispatcher
Link copied to clipboard
fun <T> Lifetime.async(    scheduler: IScheduler,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> T): Deferred<T>
fun <T> Lifetime.async(    context: CoroutineContext = EmptyCoroutineContext,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> T): Deferred<T>
Link copied to clipboard
fun Lifetime.createTerminatedAfter(duration: Duration, terminationContext: CoroutineContext): Lifetime
Link copied to clipboard
fun Lifetime.launch(    scheduler: IScheduler,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> Unit): Job
fun Lifetime.launch(    context: CoroutineContext = EmptyCoroutineContext,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
suspend fun <T> lifetimedCoroutineScope(lifetime: Lifetime, action: suspend CoroutineScope.() -> T): T

Creates a coroutineScope that will be cancelled on the passed lifetime termination

Link copied to clipboard
suspend fun ISource<Boolean>.nextFalseValue(): Boolean
Link copied to clipboard
fun ISource<Boolean>.nextFalseValueAsync(lifetime: Lifetime): Deferred<Boolean>
Link copied to clipboard
suspend fun <T : Any> ISource<T?>.nextNotNullValue(): T
Link copied to clipboard
fun <T : Any> ISource<T?>.nextNotNullValueAsync(lifetime: Lifetime): Deferred<T>
Link copied to clipboard
suspend fun ISource<Boolean>.nextTrueValue(): Boolean
Link copied to clipboard
fun ISource<Boolean>.nextTrueValueAsync(lifetime: Lifetime): Deferred<Boolean>
Link copied to clipboard
suspend fun <T> ISource<T>.nextValue(condition: (T) -> Boolean = { true }): T
Link copied to clipboard
fun <T> ISource<T>.nextValueAsync(lifetime: Lifetime, condition: (T) -> Boolean = { true }): Deferred<T>
Link copied to clipboard
fun Job.noAwait()
Link copied to clipboard
fun LifetimeDefinition.synchronizeWith(scope: CoroutineScope, supportsTerminationUnderExecution: Boolean = false)
fun LifetimeDefinition.synchronizeWith(job: Job, supportsTerminationUnderExecution: Boolean = false)
Link copied to clipboard
suspend fun waitFor(    timeout: Duration,     maxDelay: Long = 256,     lifetime: Lifetime = Lifetime.Eternal,     condition: suspend () -> Boolean): Boolean
Link copied to clipboard
suspend fun withLifetime(context: CoroutineContext = EmptyCoroutineContext, action: suspend CoroutineScope.(Lifetime) -> Unit)

The same as withContext, but creates a Lifetime that will be terminated only after the passed action and its CoroutineScope are completed

Link copied to clipboard
suspend fun <T> withRdSchedulerContext(scheduler: IScheduler, block: suspend CoroutineScope.() -> T): T

Properties

Link copied to clipboard
val IScheduler.asCoroutineDispatcher: CoroutineDispatcher