Package kotlinx.coroutines.experimental.reactor

Utilities for Reactor.

Types

SchedulerCoroutineDispatcher

open class SchedulerCoroutineDispatcher : 
    CoroutineDispatcher,
    Delay

Implements CoroutineDispatcher on top of an arbitrary Scheduler.

Extensions for External Classes

kotlinx.coroutines.experimental.Deferred

kotlinx.coroutines.experimental.Job

kotlinx.coroutines.experimental.channels.ReceiveChannel

reactor.core.scheduler.Scheduler

Functions

flux

fun <T> flux(
    context: CoroutineContext = DefaultDispatcher,
    block: suspend ProducerScope<T>.() -> Unit
): Flux<T>

Creates cold reactive Flux that runs a given block in a coroutine. Every time the returned flux is subscribed, it starts a new coroutine in the specified context. Coroutine emits items with send. Unsubscribing cancels running coroutine.

mono

fun <T> mono(
    context: CoroutineContext = DefaultDispatcher,
    parent: Job? = null,
    block: suspend CoroutineScope.() -> T?
): Mono<T>

Creates cold mono that will run a given block in a coroutine. Every time the returned mono is subscribed, it starts a new coroutine. Coroutine returns a single, possibly null value. Unsubscribing cancels running coroutine.