github reactor/reactor-core v3.1.4.RELEASE

latest releases: v3.8.5, v3.7.18, v3.8.4...
8 years ago

This is the 4th release of Reactor 3.1, part of BISMUTH-SR6 Release Train.

This is a recommended update for all Reactor 3 users.

⚠️ Update considerations and deprecations

  • The MPSC Queue implementation from 3.1.3.RELEASE shouldn't have been public (#1010, #1035)
    • it is now exposed as a plain Queue through Queues.unboundedMultiproducer()
  • 3 operator implementations have mistakenly been released as public classes (#1036)
    • These classes shouldn't have normally been noticed by users. However they have now been made private.
    • FluxDelaySequence, FluxIndex and FluxIndexFuseable
  • Emitting a Context as part of Flux.repeatWhen and Flux.retryWhen companion flux triggers a specific behavior (#1048)
    • The emitted Context, which acts as a trigger for resubscription to the source, replaces the original Context of the
      xxxWhen operator and becomes visible to the upstream from that point.
    • Care should be taken to craft that Context from the original Context, otherwise you risk blindly deleting keys from the original that 3rd party libraries rely on. (this is described in the javadoc)
  • Like Flux.zip, Mono.zip short-circuits on the first source that terminates empty, cancelling other pending sources (#1071)
    • this means that the Mono will complete as soon as any Mono<Void> source or any empty Mono<T> completes. this could lead to earlier than expected completions.
    • note this changes nothing for sources that are all valued
    • You should look for Mono.zip(...).then() pattern in your code and replace that with Mono.when(...) instead, as when does wait for all completions and results in a Mono<Void>.
    • If you want to keep the behavior of letting all valid sources run to completion, use Mono.zipDelayError, which
      won't cancel other sources (aggregating to a composite onError in case of 1+ errors, or an empty mono in case
      of 0 error and 1+ empty sources)

✨ New features and improvements

  • log now has a variant that directly takes a Logger instance, which can improve performance if the bottleneck
    is the resolution of Loggers (#956)
  • a new variant of merge, the mergeOrdered, has been added to Flux and ParallelFlux (#963)
  • Flux.concatWithValues(T...) and Mono.thenReturn(T) have been added to conveniently concat/continue with
    scalar values (#1029)
  • Operators that used to synchronize around a queue now use the new MPSC queue implementation instead (#914)
  • distinct now allows for arbitrary backing store, not necessarily a Collection, if you also provide a
    "distinct check" BiPredicate (#1054)
  • In Kotlin extensions, nullable types are mapped to non-nullable Monos (#1062)
  • Emitting a Context as part of Flux.repeatWhen and Flux.retryWhen companion flux triggers a specific behavior (see update considerations above, #1048)
  • Core implementations of Scheduler and Worker are now Scannable (#1050)
    • The interfaces themselves are not, so you'll need to attempt scanning by first calling Scannable.from(schedulerInstance)
    • ExecutorService-backed schedulers can offer a degree of insight into their executor if it is a ThreadPoolExecutor, via
      scanning of CAPACITY and BUFFERED
    • Most core executors that used to be backed by a Executors.newSingleThreadExecutor (which isn't introspectable by the above
      method) are now backed by a ThreadPoolExecutor with a corePoolSize == maxPoolSize of 1.
  • Most operators that take a Scheduler as parameter can return that Scheduler or the Worker they use via a scan()
    of the new Attr.RUN_ON attribute. A Scannable.UNAVAILABLE_SCAN is returned if that information is not available (dcc36e5)

🪲 Bug fixes

  • doOnEach could be ignored in case of a Fuseable source, due to a mistake in the way it would call its
    downstream onSubscribe method with its source rather than itself (#1056, #1067)
  • The elastic Scheduler would retain a reference to all its expired workers, which has now been fixed (#1070)
  • The TopicProcessor and WorkQueueProcessor forceShutdown() method would fail to shut down the "request task"
    backing ExecutorService (#1074)
  • Like Flux.zip, Mono.zip short-circuits on the first source that terminates empty, cancelling other pending sources
    (see update considerations above, #1071)

📖 Documentation, Tests and Build

  • Documentation improvements and typo corrections
  • Various test improvements making some tests less brittle on our CI
  • japicmp now has the previous 3.1.3.RELEASE as baseline (1c0fa6d)
  • Some tests were missing a final verify() call, and as such not testing anything (#1046)

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

@anonymousXrandom, @KPull, @pcroc, @sbuettner, @yilinwei

Don't miss a new reactor-core release

NewReleases is sending notifications on new releases.