Package kotlinx.coroutines.experimental.reactive

Utilities for Reactive Streams.

Extensions for External Classes

kotlinx.coroutines.experimental.channels.ReceiveChannel

org.reactivestreams.Publisher

Functions

publish

fun <T> publish(
    context: CoroutineContext = DefaultDispatcher,
    parent: Job? = null,
    block: suspend ProducerScope<T>.() -> Unit
): Publisher<T>

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