Skip to content
Branch: master
Find file History
qwwdfsad Consistently handle undeliverable exceptions in RxJava and Reactor in…

Use tryOnError in RxJava to make exception delivery check-and-act race free.
Deliver undeliverable exceptions via RxJavaPlugins instead of handleCoroutineException.
This is a deliberate choice for a multiple reasons:
  * When using Rx (whether with coroutines or not), undeliverable exceptions are inevitable and users should hook into RxJavaPlugins anyway. We don't want to force them using Rx-specific CoroutineExceptionHandler all over the place
  * Undeliverable exceptions provide additional helpful stacktrace and proper way to distinguish them from other unhandled exceptions
  * Be consistent with reactor where we don't have try*, thus cannot provide a completely consistent experience with CEH (at least, without wrapping all the subscribers)\

Do the similar in Reactor integration, but without try*, Reactor does not have notion of undeliverable exceoptions and handles them via Operators.* on its own.

Also, get rid of ASCII tables that are not properly render in IDEA

Fixes #252
Fixes #1614
Latest commit a930b0c Dec 5, 2019

Module kotlinx-coroutines-reactor

Utilities for Reactor.

Coroutine builders:

Name Result Scope Description
mono Mono CoroutineScope Cold mono that starts coroutine on subscribe
flux Flux CoroutineScope Cold flux that starts coroutine on subscribe

Note that Mono and Flux are a subclass of Reactive Streams Publisher and extensions for it are covered by kotlinx-coroutines-reactive module.

Integration with [Flow]:

Name Result Description
Flow.asFlux Flux Converts the given flow to the TCK-compliant Flux.

This adapter is integrated with Reactor's Context and coroutines [ReactiveContext].

Conversion functions:

Name Description
Job.asMono Converts job to hot mono
Deferred.asMono Converts deferred value to hot mono
ReceiveChannel.asFlux Converts streaming channel to hot flux
Scheduler.asCoroutineDispatcher Converts scheduler to CoroutineDispatcher

Package kotlinx.coroutines.reactor

Utilities for Reactor.

You can’t perform that action at this time.