github reactor/reactor-core v3.1.0.M1

latest releases: v3.8.5, v3.7.18, v3.8.4...
pre-release9 years ago

This is the MILESTONE 1 release of Reactor 3.1.0, which will be part of the Bismuth Release Train.

This MILESTONE covers API changes of the upcoming 3.1.0 release, as well as a few improvements.
Most API changes have been introduced using a deprecate-and-offer-alternative strategy in the latest releases in the 3.0.x branch.
However, please have a look at the section below for update considerations if you haven't progressively updated each new 3.0.x.

⚠️ Update considerations and API changes

  • From a general perspective, most deprecated elements in 3.0.x have now been removed (#323)
  • ⚠️ Mono.then(Function) and Mono.flatMap(): how to migrate (#516):
    • first replace all usage of Mono.flatMap with flatMapMany
    • then replace all usage of Mono.then(Function) (which has been removed) with flatMap.
    • the gist of this change is that the old flatMap was actually changing the return type to Flux and was thus missing the "Many" suffix we usually use. At the same time, then(Function) was transforming the source value (unlike any other form of then which usually just ignore the emissions and act on the onComplete). Thus it was actually more of a flatMap.
  • error handling operators have been made more consistent between Mono and Flux (#533, #535, #531)
    • Flux: onErrorResumeWith -> onErrorResume, mapError -> onErrorMap, switchOnError -> replace with onErrorResume with a lambda that ignores the left hand side.
    • Mono: otherwise -> onErrorResume, otherwiseReturn -> onErrorReturn, otherwiseIfEmpty -> switchIfEmpty, mapError -> onErrorMap
  • buffer operators that take a (Publisher, Function) as arguments (open boundary and closing selector) have been renamed to bufferWhen. This improves the situation where having multiple lambda-based signature can create ambiguity (even more so in languages like Kotlin) (#542)
  • delay in Flux is removed in favor of Flux.delayElements (see #263)
  • doAfterTerminate doesn't cause an onError signal if its callback fails (#270)
  • then:
    • variants of then that took a Supplier have been removed. Use defer if you really need to provide the continuation Mono lazily (#547)
    • Flux.then(Publisher<Void>) has been removed in favor of thenEmpty
    • Mono.then(Function) is now Mono.flatMap (see 1st entry)
  • window:
    • various window operators have been aligned in behavior with respect to cancellation (#384)
    • window operators that take a (Publisher, Function) as arguments (open boundary and closing selector) have been renamed to windowWhen. This improves the situation where having multiple lambda-based signature can create ambiguity (even more so in languages like Kotlin) (#542)
    • Flux.window() has been removed in favor of window(Publisher), windowUntil and windowWhile(see #260)
  • zip(Iterable) in Flux has been removed as it was by nature unusable (#338)
  • Cross operator changes based on prefix / parameter pattern:
    • xxxMillis: Timed operators with the Millis suffix have been removed, use their Duration based counterparts
    • xxx(boolean delayError): All operators that were taking a delayError boolean parameter instead of having a DelayError suffixed variant now use the suffix variant pattern (see #480)
    • xxx(Function<Throwable, ?>): Operators dealing with a Predicate or Function of Throwable have been aligned to take a more generic <? super Throwable>
    • All subscribe methods in Flux that had a prefetch parameter have been removed (you can use limitRate to achieve the same effect)
  • Removal of interfaces and classes:
    • Old introspection interfaces, which were mostly only used internally, have been removed in favor of the single Scannable interface (Loopback, MultiProducer, MultiReceiver, Producer, Receiver, Trackable, see #249, 20bd64d)
    • Cancellation has been removed and replaced with Disposable (see #322, 844769d)
    • TimedScheduler has been removed, as well as the Scheduler#shutdown method (all schedulers are now time capable and you can use dispose(). Note that most timed operators now use the parallel() Scheduler by default. see #451, #322)
  • Processors have been reworked. Notably you cannot connect explicitly anymore but should rather use the sink() method. For details and rationale, see #525.
  • Some changes have been made to Operators support class for writing custom operators:
    • Operators.SubscriberAdapter is not part of the public API anymore.
    • Operators.addAndGet(AtomicLong, ...) has been removed in favor of the AtomicLongFieldUpdater alternative.

✨ New features and improvements

  • Added a Flux.then(Mono) operator to align with the Mono equivalent (#547)
  • Added Mono.delayUntil and Mono.delayUntilOther to delay the emission of a Mono until after a companion Publisher completes (which can be generated from the source value in the case of delayUntil). This is very close to untilOther except it acts on onComplete. (#558, #568)
  • The error message in case some operators badly behave with backpressure ("Queue full?!") has been made more explicit (#540)
  • ParallelSubscriber now has a subscribe() method and all subscribe(...) methods are final like in Flux (#564)

🪲 Bug fixes

  • Mono.untilOther would not return a new instance when chained with itself (#515)
  • Operators#setOnce was cancelling the wrong subscription

📖 Documentation, Tests and Build

  • The javadoc has been reviewed and polished across the board. Most notably, a full review of Flux and Mono javadoc has been made. It also now outputs UTF-8 html, and a few marble diagrams were added (#545, #559, #528, #513, #544)
  • the reference documentation has been updated to keep up with new/modified operators (#516, #535, #555)

👍 Thanks to the following contributors that also participated to this release

@rajinisivaram, @sdeleuze, @schauder, @Dmitriusan, @garyrussell

Don't miss a new reactor-core release

NewReleases is sending notifications on new releases.