This is the first RELEASE CANDIDATE of Reactor 3.0, part of upcoming Bismuth-RELEASE Release Train.
This is a recommended update for all Reactor 3 users.
⚠️ Update considerations and deprecations
samplewill now include the last element in the source sequence if it terminates with an open sampling window (#724)Scannable.getOrDefaultwill always use the provided default and no longer rely on theAttrglobal default as an intermediate fallback (#785)Signalis now an interface andMutableNextSignalhas been removed (#779)Hooks: new hooksonEachOperator+onLastOperator, nowFunction<Publisher, Publisher>, new operatorlift(#775) TODO expand on thiswindowUntil/windowWhilehaveFluxwindows instead ofGroupedFlux(#759)Flux.cache(Duration)now expires the termination signal as well (#750)Mono#whenvariants are nowzip. Corresponding Kotlin extensions have also been removed (zip isn't a keyword) (#789 + 52f7f04)ParallelFlux#subscribe(lambdas)lambda-based variants now return aDisposable(composite of all rails subscribers, #800)- MonoProcessor cancel/dispose now signals
CancellationException(#792) Operators.onNextDroppeddefault behaviour is to log the drop rather than throw a "fail with cancel" exception (#823)DirectProcessorandUnicastProcessor now call onErrorDropped and onNextDropped if calling after terminate.Exceptions.argumentIsNullException()has been removed (most of the time replaced byObjects.requireNonNull()`). (7f6ff86)- Hooks in
Operators(eg.onOperatorError) must now be called with theContext(#830) Mono.doOnTerminateanddoAfterTerminatenow take a simpleRunnable(aligning the API withFlux). The olddoOnTerminate(BiConsumer<Throwable, T>)can be achieved with the addeddoOnSuccessOrErrorand olddoAfterTerminate(BiConsumer<Throwable, T>)withdoAfterSuccessOrError(BiConsumer<Throwable, T>). (#836 + 80a3210)Flux.firstEmittingis now calledfirstandFlux.firstEmittingWithis now calledor, aligning APIs with those ofMono(#849)- static
Mono.empty(Publisher<?>)has been removed, prefer using the newMono.when(p)(2e7fdf3) - Context API refinement:
- Review interrupted flag on dispose (#507)
- Removed fromExecutorService(exec, boolean) variant
- Removed factory hook for simple ExecutorService (now all Scheduled)
- Rename
Mono.currentContexttosubscriberContext()(#831) - Operators.onErrorDropped, onNextDropped, onOperatorError and onRejectedExecution now also take the Context as parameter (7ae167f, a9df084)
OpenHashSethas been removed, as it was only used for Disposables: useDisposables.composite()(40fbd60)
✨ New features and improvements
- Upgrade to Kotlin 1.1.4-3
- Add ability to name and tag a reactive sequence (#579)
- Add a new Console logger, now the default fallback instead of JDK logger (#680)
- Add utility method to check if a Throwable is composite (#770)
- Add Swap & Composite Disposable specializations (#731, bf8d8cb)
- onEachOperator/onLastOperator/onOperatorError hooks can be named, allowing for additive hooks AND partial hook reset (#784)
- Offer way to do requests on original thread with
subscribeOn(#777) - Add
take(Duration)andtakeUntilOther(Publisher)to Mono (#797) - Have ParallelFlux lambda subscribe return composite Disposable (#800)
- Add Disposable single(), disposed() and never() factories to a
Disposablesutility class ( #799, #804, #812) - Context API refinements: factory methods and specialized implementations for 1-5 elements (#780)
- Add
Mono.cache(Duration)(#683) - Add "not dropped" assertions to StepVerifier assertions (96ae5ca)
- Add
Context#delete(key)(#817) - onErrorDropped/onNextDropped/onOperatorError/onRejectedExecution look for local hooks in the
Context(b576f7f) - Add a PublisherProbe to easily probe for subscription in tests (#833)
- Return original reference if unwrapped exception is null (#848)
🪲 Bug fixes
- ParallelScheduler does not schedule task evenly between threads (#761)
- Pass failed signal to onOperatorError in trySubscribeScalarMap (#684)
- Remove cancel during onNext for
MonoDelayElement(#749) Attr.LARGE_BUFFEREDdefaults back to null (as in "irrelevant") (#751)- Revert publishOn async path detection over-optimization (#767)
- Exceptions.addThrowable now reuse same root composite (#771)
- Guard ExecutorScheduler against Executor's task failures (#324)
- Catch fused
flattenIterablepolling failures (#841) - Fix
windowTimeoutrejection double cancel (31ef92d) - VirtualTimeScheduler shutdown is not correctly handled with periods (#776)
- Protect immediate flatMap scalar emissions from out of order consuming (c7d3c12, 3abcb83, ce49077)
- Ensure no
Subscription#requestthrows/errors (4d61440, decfa13) - Avoid the shortcut of MonoProcessor.onNext(null) for onComplete (#701)
📖 Documentation, Tests and Build
- various typos have been fixed in javadocs, README, reference guide
- the reference guide has been reviewed and wording improved
- Document groupBy caveats, as well as other batching methods (#726)
- Android compatibility and best effort support is described in README statement (#796)
- Contributing to the documentation is explained and made easier with direct edit links (#801, #808)
- Added a clarification
sink()will subscribe the emitter (2cd83c2)
👍 Thanks to the following contributors that also participated to this release
@akarnokd, @Buzzardo, @helmbold, @lebannen, @olibye, @rajinisivaram, @sdeleuze, @violetagg, @zgagnon