kotlinx-coroutines-reactive

Utilities for Reactive Streams.

Coroutine builders:

NameResultScopeDescription
kotlinx.coroutines.reactive.publishPublisherProducerScopeCold reactive publisher that starts the coroutine on subscribe

Integration with Flow:

NameResultDescription
Publisher.asFlowFlowConverts the given publisher to a flow
Flow.asPublisherPublisherConverts the given flow to a TCK-compliant publisher

If these adapters are used along with kotlinx-coroutines-reactor in the classpath, then Reactor's Context is properly propagated as coroutine context element (ReactorContext) and vice versa.

Suspending extension functions and suspending iteration:

NameDescription
Publisher.awaitFirstReturns the first value from the given publisher
Publisher.awaitFirstOrDefaultReturns the first value from the given publisher or default
Publisher.awaitFirstOrElseReturns the first value from the given publisher or default from a function
Publisher.awaitFirstOrNullReturns the first value from the given publisher or null
Publisher.awaitLastReturns the last value from the given publisher
Publisher.awaitSingleReturns the single value from the given publisher

Packages

Link copied to clipboard

Utilities for Reactive Streams.