Skip to content

Releases: reactor/reactor-core

v3.1.2.RELEASE

17 Nov 03:38
Compare
Choose a tag to compare

This is the 3rd release of Reactor 3.1, part of BISMUTH-SR4 Release Train.

This is a recommended update for all Reactor 3 users. It notably contains a new Flux operator called index to index as a Tuple<Long, T> or any arbitrary container each element from a sequence.

✨ New features and improvements

  • Add Flux#index operator (#934)
  • Add Mono#single to enforce the presence of an element in a Mono<T> (#940)
  • Add Mono#blockOptional to block and return an Optional (#918)
  • Add Flux#fromStream(Supplier<Stream>) (#922)
  • Use an explicit timeout message for timeout operator (#925)
  • Add a Kotlin extension to create a Mono from a Supplier (#929)

πŸͺ² Bug fixes

  • Fix concatDelayError and concatMapDelayError with Mono.error (#936)

πŸ“– Documentation, Tests and Build

  • Add Context simple example in reference guide (#921)
  • Fix javadoc marble for Mono.repeatWhenEmpty (#919)
  • Fix CLA in Contributing.md (#98b32f5)
  • Fix links to JDK Reference (#a0d8126)
  • Add cache(Duration) javadoc (#930)
  • Fix Context content in test (#950)
  • Improvve Scheduler javadoc (#935)

πŸ‘ Thanks to the following contributors that also participated to this release

@baptistemesta, @naxhh

v3.1.1.RELEASE

23 Oct 09:55
Compare
Choose a tag to compare

This is the 2nd release of Reactor 3.1, part of BISMUTH-SR2 Release Train.

This is a recommended update for all Reactor 3 users. It notably contains an important fix for a Flux#windowTimeout bug introduced in v3.1.0.

✨ New features and improvements

  • Overflow exception for interval has been clarified, making it clearer that interval doesn't really support backpressure (#911)
  • Improved means of customizing the request amount mid-chain: new limitRequest operator will strictly cap the total request (without prefecthing, unlike limitRate) and limitRate now has a variant that takes a lowTide parameter that allow to customize the replenishing amount (#879, #894)
  • Kotlin extension now extends Publisher with toFlux and toMono operations (#908)

πŸͺ² Bug fixes

  • Flux#windowTimeout with <10ms timeouts could trigger race conditions and lose some windows/drop data to already closed windows. The operator has consequently been reworked (#912)
  • Periodic tasks of Schedulers and Workers are now correctly cancelled by calling dispose() (#880)
  • Ensure that Scannable scanning of PARENT and ACTUAL always returns a Scannable, even if the original unsafe scan didn't. In the later case, the UNAVAILABLE_SCAN instance is returned (#895)
  • ParallelFlux (.parallel()) is now considered a THREAD_BARRIER for fusion purposes, allowing sensitive operators to skip fusion (#905)

πŸ“– Documentation, Tests and Build

  • Several typos fixed and rephrasing have been made (#885, #868, #902)
  • Reference guide now has a small section on reactor-extra (#899)
  • Build has been upgraded to Gradle 4.2, binary compatibility is now checked with a baseline (3.1.0.RELEASE) using japicmp (#884)
  • Java 9: fixed deep reflection issue and additional build with JDK9 in Travis CI (minus a few elements due to build dependencies not being ready, #881, #883, #891)
  • The Kotlin plugin has been upgraded to 1.1.51, with a workaround for a source jar class duplication issue (#889, #887)
  • OSGI compatibility has been improved with the removal of extraneous packages and marking kotlin and JSR305 as optional (#903)

πŸ‘ Thanks to the following contributors that also participated to this release

@0xflotus, @Buzzardo, @kadyana, @quaff, @sdeleuze

v3.1.0.RELEASE

25 Sep 17:05
Compare
Choose a tag to compare

This is the first release of Reactor 3.1, part of Bismuth-RELEASE Release Train.

This version is a recommended update for all Reactor 3 users, and will be the one backing Spring Framework 5.0. A lot of API polishing has occurred between the last 3.0.x release and this one, so please read the release notes below carefully if you didn't progressively upgrade through the various MILESTONEs and RCs. (if you only care about what changed since RC1, please have a look at the RC2 release note)

The release notes below are written from the perspective of a migration from 3.0.x latest version and cover
changes across all the 3.1.0 pre-releases.

Note that since pre-release v3.1.0.M2, the source code for the reactor-test artifact is part of the reactor-core github repository.

⚠️ Update considerations and deprecations

  • Reactor has been updated to pass the TCK of the new Reactive Streams specification 1.0.1.RC2. A new StrictSubscriber enforces RS rules more strictly when going out of the Reactor world and bridging to an external Publisher (#711)

  • The reactor-test artifact is now part of the io.projectreactor groupId (and reactor-core github repository)

  • Kotlin extensions for core and test are now part of the reactor-core repo and artifacts

  • behavioral changes

    • doAfterTerminate doesn't cause an onError signal if its callback fails (#270)
    • sample will now include the last element in the source sequence if it terminates with an open sampling window (#724)
    • Flux.cache(Duration) now expires the termination signal as well (#750)
  • Flux/Mono method changes

    • ParallelFlux#subscribe(lambdas) lambda-based variants now return a Disposable (composite of all rails subscribers, #800)
    • Flux#toIterable now takes an int for its batchSize argument (f3e13bf)
    • Mono.doOnTerminate and doAfterTerminate now take a simple Runnable (aligning the API with Flux). The old doOnTerminate(BiConsumer<Throwable, T>) can be achieved with the added doOnSuccessOrError and old doAfterTerminate(BiConsumer<Throwable, T>) with doAfterSuccessOrError(BiConsumer<Throwable, T>). (#836 + 80a3210)
    • Flux.firstEmitting is now called first and Flux.firstEmittingWith is now called or, aligning APIs with those of Mono (#849)
    • static Mono.empty(Publisher<?>) has been removed, prefer using the new Mono.when(p) (2e7fdf3)
    • 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)
    • Mono#untilOther removed (use delayUntil(it -> other.take(1)) instead, see #558)
  • 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
  • Mono zip vs when

    • zip is the operator dedicated to producing Tuples (or equivalent combinations) of the elements from multiple sources.
      As a consequence, when and and variants that produced a Tuple have now been renamed zip and zipWith (#789 + 52f7f04)
    • when and and still exist, as operators in the same family as then: they only care about completion signals,
      discarding elements and returning a Mono<Void>.
    • Mono#zip with an iterable: for consistency, swap the arguments (old "function, iterable" version is deprecated, see #619)
    • zip(Iterable) and zip(Function, Iterable)in Flux has been removed (#338, #619)
  • ⚠️ 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
  • 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)
    • Flux.windowTimeOrSize: the timeout now starts right from subscription, resulting in potentially empty windows being emitted. It also restarts if the
      timeout expires, so there could be several empty windows emitted eg. 3 for a timeout of 100ms if the Flux doesn't emit for 300ms.
      The equivalent buffer version remains unchanged. (#484)
    • windowUntil/windowWhile have Flux windows instead of GroupedFlux (#759)
  • 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)
  • class changes

    • Signal is now an interface and MutableNextSignal has been removed (#779)
    • 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 (most schedulers are now fully time capable and you can use dispose(). The few Scheduler that are not time-capable will throw a RejectedExecutionException indicating so whenever one attempts to use schedulePeriodically on them. Note that most timed operators now use the parallel() Scheduler by default. (see #451, #322)
    • Review interrupted flag on dispose (#507)
    • Removed fromExecutorService(exec, boolean) variant
    • Removed factory hook for simple ExecutorService (now all Scheduled)
    • OpenHashSet has been removed, as it was only used for Disposables: use Disposables.composite() (40fbd60)
    • QueueSupplier has been renamed to Queues and is now purely about queue-related utils and static suppliers. It doesn't implement Supplier<Queue> itself anymore. (#733)
  • Hooks

    • Hooks are now cumulative. Setting a hook will add it on top of the existing one(s). You can also name
      some hooks, which allows to update a sub-hook or only partially reset a hook. (#687, #784)
    • new hooks onEachOperator + onLastOperator, now Function<Publisher, Publisher>, new operator lift (#775)
    • hooks must now be called with the Context (#830)
  • nullability

    • Nullability checks are helped with the use of annotations. Most of the Reactor API is NonNull (#614)
    • Some additional non-null checks are enforced, notably on all Tuple (#696)
  • Processors have been reworked:

    • You cannot connect explicitly anymore but should rather use the sink() method. For details and rationale, see #525.
    • Processors that are costly to instantiate (TopicProcessor, WorkQueueProcessor) now have a Builder instead of
      factory methods. However, they keep a couple of significant factory methods (see #471, #616 and #628)
    • Mono#subscribe() returns a Disposable. Use .toProcessor() to get the exact legacy behavior (see #566, #605 and #638)
    • UnicastProcessor won't ignore the overflowStrategy if we can detect that a bounded queue is used. By default, an unbounded queue is used and the strategy is silently ignored. (#612)
    • DirectProcessor and UnicastProcessor now call onErrorDropped and onNextDropped if calling after terminate. Exceptions.argumentIsNullException() has been removed (most of the time replaced by Objects.requireNonNull()). (7f6ff86)
    • MonoProcessor cancel/dispose now signals CancellationException (#792)
  • Some changes have been made to the way writing custom operators works

    • Operators.SubscriberAdapter is not part of the public API anymore.
    • Operators.addAndGet(AtomicLong, ...) has been removed in favor of the AtomicLongFieldUpdater alternative, itself renamed to addCap (#371)
    • Removed unused and confusing Operators.addAndGet (#371)
    • MonoSource and FluxSource are now package privat...
Read more

v3.1.0.RC2

25 Sep 12:53
Compare
Choose a tag to compare
v3.1.0.RC2 Pre-release
Pre-release

This is the second RELEASE CANDIDATE of Reactor 3.1.0, preparing for the upcoming Bismuth Release Train.

This is a recommended update for all Reactor 3 users.

⚠️ Update considerations and deprecations

  • Flux#toIterable now takes an int for its batchSize argument (f3e13bf)
  • Removed unused and confusing Operators.addAndGet (#371)
  • Renamed Operators.getAndAddCap to addCap (#371)

✨ New features and improvements

  • Added the expand operator (#769)
  • Mono#fromCallable/fromSupplier now map null result to empty Mono (#743)
  • Introduce Reactor nullability annotations (#864, #873, #875)

πŸͺ² Bug fixes

  • Fix recursive context bug on flatMapMany (8e33991)
  • Add reason to default Scheduler exception throwing (#854)
  • Change Operators subscriptions from enum to final classes (#857)
  • Safely suppress exceptions through Exceptions.addSuppressed (#758)
  • ParallelFlux now correctly support conditional subscribers (#865, #389)
  • MonoProcessor shouldn't have been a strict subscriber (#866)
  • Review int.max prefetch (f3e13bf)
  • Multicast cancel now disposes upstream properly (#870)
  • Protect serializedSink from illegal subscriber onNext throw (#613)
  • Improve progressive demand handling (#371)

πŸ“– Documentation, Tests and Build

πŸ‘ Thanks to the following contributors that also participated to this release

@osi @rdegnan @sdeleuze

v3.1.0.RC1

06 Sep 08:45
Compare
Choose a tag to compare
v3.1.0.RC1 Pre-release
Pre-release

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

  • sample will now include the last element in the source sequence if it terminates with an open sampling window (#724)
  • Scannable.getOrDefault will always use the provided default and no longer rely on the Attr global default as an intermediate fallback (#785)
  • Signal is now an interface and MutableNextSignal has been removed (#779)
  • Hooks: new hooks onEachOperator + onLastOperator, now Function<Publisher, Publisher>, new operator lift (#775) TODO expand on this
  • windowUntil/windowWhile have Flux windows instead of GroupedFlux (#759)
  • Flux.cache(Duration) now expires the termination signal as well (#750)
  • Mono#when variants are now zip. Corresponding Kotlin extensions have also been removed (zip isn't a keyword) (#789 + 52f7f04)
  • ParallelFlux#subscribe(lambdas) lambda-based variants now return a Disposable (composite of all rails subscribers, #800)
  • MonoProcessor cancel/dispose now signals CancellationException (#792)
  • Operators.onNextDropped default behaviour is to log the drop rather than throw a "fail with cancel" exception (#823)
  • DirectProcessor and UnicastProcessor 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 the Context (#830)
  • Mono.doOnTerminate and doAfterTerminate now take a simple Runnable (aligning the API with Flux). The old doOnTerminate(BiConsumer<Throwable, T>) can be achieved with the added doOnSuccessOrError and old doAfterTerminate(BiConsumer<Throwable, T>) with doAfterSuccessOrError(BiConsumer<Throwable, T>). (#836 + 80a3210)
  • Flux.firstEmitting is now called first and Flux.firstEmittingWith is now called or, aligning APIs with those of Mono (#849)
  • static Mono.empty(Publisher<?>) has been removed, prefer using the new Mono.when(p) (2e7fdf3)
  • Context API refinement:
    • Mono#currentContext does emit empty contexts rather than terminating empty (#816)
    • contextStart renamed to subscriberContext, remove contextGet (#780)
  • Review interrupted flag on dispose (#507)
    • Removed fromExecutorService(exec, boolean) variant
    • Removed factory hook for simple ExecutorService (now all Scheduled)
  • Rename Mono.currentContext to subscriberContext() (#831)
  • Operators.onErrorDropped, onNextDropped, onOperatorError and onRejectedExecution now also take the Context as parameter (7ae167f, a9df084)
  • OpenHashSet has been removed, as it was only used for Disposables: use Disposables.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) and takeUntilOther(Publisher) to Mono (#797)
  • Have ParallelFlux lambda subscribe return composite Disposable (#800)
  • Add Disposable single(), disposed() and never() factories to a Disposables utility 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_BUFFERED defaults 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 flattenIterable polling failures (#841)
  • Fix windowTimeout rejection 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#request throws/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

v3.1.0.M3

18 Jul 04:29
Compare
Choose a tag to compare
v3.1.0.M3 Pre-release
Pre-release

This is the MILESTONE 3 release of Reactor 3.1, part of Bismuth-M3 Release Train.

This is a recommended update for all Reactor 3 users.

⚠️ Update considerations and deprecations

  • Nullability checks are helped with the use of annotations. Most of the Reactor API is NonNull (#614)
    • some additional non-null checks are enforced, notably on all Tuple (#696)
  • Processor builders: The move to builders from M2 has been partially reverted. Only Processors that are costly to instantiate have a Builder (TopicProcessor, WorkQueueProcessor). They also keep a couple of significant factory methods (#616)
  • UnicastProcessor won't ignore the overflowStrategy if we can detect that a bounded queue is used. By default, an unbounded queue is used and the strategy is silently ignored. (#612)
  • QueueSupplier has been renamed to Queues and is now purely about queue-related utils and static suppliers. It doesn't implement Supplier<Queue> itself anymore. (#733)
  • Hooks are now cumulative. Setting a hook will add it on top of the existing one(s) and you need to reset the hook if you want to replace the current one. (#687)
  • Flux.error and Mono.error are now ScalarCallable and the error case can be fused when source is scalar (#716)
  • Some methods deprecated in M2 have been removed (see #323)
    • part of the factory methods of TopicProcessor and WorkQueueProcessor (the simpler processors have had their factory methods un-deprecated) (#471, #616)
    • untilOther, which is replaced by the more useful delayUntil (use a lambda ignoring the left-hand side if necessary) (#558)
    • zip(Function, Iterable) (#619)
  • delayUntilOther has been removed (use a lambda ignoring the left-hand side instead)
  • delayUntilDelayError has been removed (in flux concatMap can be used to achieve similar delayError effect; in mono, delay error doesn't really make sense)
  • MonoSource and FluxSource are now package private, superseded by MonoOperator and FluxOperator.
  • Scannable attributes are now regrouped back into a single generic class Attr<T>. This is a quasi-enumeration exposing constants rather than enums. (#728)
    • 🐞 LARGE_BUFFERED has a default of 0 in this version instead of null in M2, but that is a mistake that will be fixed in RC1 (see #751)
  • Reactor has been updated to pass the TCK of the new Reactive Streams specification 1.0.1.RC2. A new StrictSubscriber enforces RS rules more strictly when going out of the Reactor world and bridging to an external Publisher (#711)
  • ✨ Associating a Context to a reactive sequence ✨ (Flux or Mono) is now possible. This is the major new feature in this milestone. (#117, #210, #337, #447, #704, #705, #723 and various other PRs)
    • Added CoreSubscriber, a Reactor-specific Subscriber common to all Flux and Mono operators and needed to pass along the Context
    • Flux#subscribe(Subscriber) is now final, and one needs to instead implement subscribe(CoreSubscriber) in custom operators / Flux.
    • the context is enriched during the subscription phase, possibly via the contextStart operator (wich takes a Function<Context, Context>). In order to access it in the data path, the contextGet operator has been added. It takes a BiFunction<T, Context, R>, allowing to transform the data depending on the Context.
    • There is a static factory method Mono#currentContext that can be used to emit the Context initialized downstream of it (or propagated inside eg. a flatMap)
    • Context propagation and initialization is only done during the subscription phase, in reverse order of the chain of operators.

✨ New features and improvements

  • Null analysis has been enabled through the use of Nullable/NonNullApi annotations (#614)
  • Reduce WorkQueueProcessor/TopicProcessor sink serialization when it is not necessary (#630, #727)
  • Added a distinctUntilChanged variant with a bipredicate to evaluate if there is a change (#608)
  • Added a onBackpressureBuffer variant with a TTL (#296)
  • Added an optional configurable default timeout on StepVerifier#verify() (#651)
  • Added expect|verifyErrorSatisfies StepVerifier error expectations (#670)
  • Flux now also has the delayUntil operator (#674)
  • A new global hook has been added: Hooks.onNewSubscriber
  • When using Mono.fromRunnable, the resulting Mono's generic type is better inferred (#686)
  • Assembly tracking internals have been improved, allowing to cache assembly stacktrace notably (#712)
  • Kotlin extensions for core and test are now part of the reactor-core repo and artifacts

πŸͺ² Bug fixes

  • StepVerifier now ignores empty multivalue expectations, which could previously lead to bad assertions (#650)
  • Fixed a bug were macro-fusion of Flux#then and Mono#then would use arrays of incompatible types, resulting in an ArrayStoreException (#661)
  • When a doOnNext callback would fail, when fused it wouldn't be caught by a doOnError (#664)
  • filterWhen had a bug in tracking request and produced amount, resulting in under-requesting hangs (#689, #692)
  • MonoProcessor could unnecessarily retain references to objects from its source. This is fixed by nulling out the source upon all terminations (#690)
  • MonoProcessor#block() had a legacy inner timeout. It will now indefinitely wait for the actual completion. On the other hand, using a negative or 0 timeout in the Duration-based variant will now immediately time out. (#722)
  • scan accumulation in a live reduction with a seed would always lag by one. It has been modified so that the seed is sent immediately, which allows the accumulator to run in lockstep with the upstream stage. (#609)
  • Fixed an issue where refCnt with grace period doesn't forget subscribers when terminated, yet still reconnects. This was due to bad recycling in publish/replay. (#675)
  • In Flux.create, setting an onDispose callback on the Sink after its onRequest method was called was ignored. The callback is now explicitly invoked if set after the sink was terminated. (#643)

πŸ“– Documentation, Tests and Build

  • Added tests and docs for multi-threaded producer with Processor sink, thread affinity using publishOn (#469, #521, #698)
  • fix JMH IntelliJ integration: back to plugin, not imported as src scope
  • Travis CI build script: only test reactor-test if all changes are in reactor-test/
  • Fixed title of reactor-test javadoc + fix links to core (#644)
  • Made javadoc external links slightly stand out
  • Improved wording on several javadoc items and reference guide subsections

πŸ‘ Thanks to the following contributors that also participated to this release

@IlyaZinkovich, @markotron, @osi, @rajinisivaram, @sdeleuze

v3.1.0.M2

06 Jun 22:38
Compare
Choose a tag to compare
v3.1.0.M2 Pre-release
Pre-release

This is the MILESTONE 2 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 improvements.

Note that starting from this pre-release, the source code for the reactor-test artifact is part of the reactor-core github repository.

Most deprecations introduced in this pre-release should be followed by a removal in the next pre-release (or GA if no M3 happens).

⚠️ Update considerations and API changes

  • Mono#subscribe() returns a Disposable. Use .toProcessor() to get the exact legacy behavior (see #566, #605 and #638)
  • Flux.windowTimeOrSize: the timeout now starts right from subscription, resulting in potentially empty windows being emitted. It also restarts if the
    timeout expires, so there could be several empty windows emitted eg. 3 for a timeout of 100ms if the Flux doesn't emit for 300ms.
    The equivalent buffer version remains unchanged. (#484)
  • reactor-test source code is now part of this repository, and the artifact has changed Maven groupId to io.projectreactor
  • Mono#untilOther removed (use delayUntilOther(other.take(1)) instead, see #558)
  • Most factory methods of Processors are deprecated in favor of Builder (see #471, #616 and #628)
  • Scannable: attributes are now split into typed categories (eg. BooleanAttr) so that scan doesn't need a Class to attempt a cast. Operator implementation is still based on a Object scan, scanUnsafe. Some operators mapped some attributes to a value of incoherent type, which has been modified to fit the category of said attributes (see #606).
  • Mono#zip with an iterable: for consistency, swap the arguments (old "function, iterable" version is deprecated, see #619)

✨ New features and improvements

  • the checkpoint description is included inFlux/MonoSource#toString (#611)
  • checkpoint(String) is now light by default, lowering the cost of using that operator (see #587)
  • the Supplier used for distinct can be tuned (#577)
  • refCount now has a variant that waits for a grace period before unsubscribing from upstream (#569, #624, #627)

πŸͺ² Bug fixes

  • a memory leak has been fixed in SingleScheduler.schedule (#578)

πŸ“– Documentation, Tests and Build

  • some operators' usage restrictions have been better documented in the javadoc (#560,#596)
  • the reference guide's introduction to reactive programming shows an example of Future and Callback Hell, vs Reactor (#580)

πŸ‘ Thanks to the following contributors that also participated to this release

In alphabetical order:

@akarnokd, @Dmitriusan, @fabriziofortino, @jimhorng, @kamilszymanski, @making, @rajinisivaram, @TomekJurkowski

v3.1.0.M1

28 Apr 14:58
Compare
Choose a tag to compare
v3.1.0.M1 Pre-release
Pre-release

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

v3.0.7.RELEASE

20 Apr 09:05
Compare
Choose a tag to compare

This is the 7th release of Reactor 3.0, part of Aluminium Release Train.

It contains backports of bug fixes and API deprecations from the 3.1.0 branch,
the later allowing to lay an easier migration path ahead of time when possible.
This is a recommended update for all Reactor 3 users.

⚠️ Update considerations and deprecations

  • Mono.flatMap becomes flatMapMany. In turn in 3.1.0 flatMap will change to the signature and behavior of current Mono.then(Function). This is semantically more correct as a flatMap traditionally returns the same type as the type it is called from (here Mono, not Flux). (#516)
    • Note that the deprecation notes refer one each other. If you want to try out the future behavior, keep using then and use flatMapMany instead of flatMap. You will have to migrate from then to flatMap in 3.1.0.
  • Prepare migration path for deep Processor rework: connect and connectSink should not be necessary anymore, Processors now have a common sink and serialize API (#525)
  • Flux/Mono error handling APIs have been realigned (#535):
    • Mono.otherwise and Flux.onErrorResumeWith aligned on onErrorResume
    • mapError aligned to onErrorMap
    • Mono.otherwiseReturn aligned to onErrorReturn
    • Mono.otherwiseIfEmpty aligned to switchIfEmpty
    • Flux.switchOnError(x) to be replaced with onErrorResume(ignore -> x)
      (notice the introduction of the lambda, but it ignores the parameter)
  • Overloads of then and its variants that take a Supplier<Mono|Publisher> are deprecated (#547)
    • Instead use the simpler overloads (Publisher/Mono based) but with a Flux.defer or Mono.defer instead of the Supplier to lazily instantiate the publisher.
  • The buffer and window variants that take both a Publisher and Function to respectively define the opening and closing boundaries for the buffer/window are deprecated in favor of a new bufferWhen / windowWhen variant (#542)

✨ New features and improvements

  • Introduce Mono.flatMapMany and Mono.flatMap (#516)
  • Introduce Flux and Mono onErrorMap (#535)
  • Introduce Mono.onErrorReturn, Mono.switchIfEmtpy (#535)
  • Introduce Flux.bufferWhen, Flux.windowWhen (#542)

πŸͺ² Bug fixes

  • Return new instance when chaining several Mono.untilOther (#515)
  • Fix Operators#setOnce cancelling the wrong subscription
  • Fix DeferredSubscription#isCancelled

πŸ“– Documentation, Tests and Build

  • add missing deprecated notice to subscribe(Consumer, int)
  • Javadoc is now built with support for Java 8 apiNote tag and UTF8 charset

v3.0.6.RELEASE

04 Apr 10:16
Compare
Choose a tag to compare

This is the 6th release of Reactor 3.0, part of Aluminium-SR2 Release Train.

This is a recommended update for all Reactor 3 users.

⚠️ Update considerations and deprecations

  • In this release, we evaluated and polished ad-hoc public api usage in preparation for the next major release 3.1.0. Specifically we:
    • Deprecated Flux and Mono xxxMillis(long, ...) signatures in favor of a unique xxx(Duration) alternative. (see #436)
    • Merged the now deprecated TimedScheduler into Scheduler for an easier execution contract (see #451).
    • Deprecated Operators.SubscriberAdapter which was encouraging inefficient encapsulation.
    • Merged introspection interfaces Trackable, Loopback, Producer, Receiver, MultiReceiver and MultiProducer into a single Scannable contract for easier serviceability extension development. (see #249)
    • Deprecated ambiguous FluxSink/MonoSink.setCancellation in favor of fluent and explicit onCancel and onDispose. It's important to distinguish the various reactor shutdown states:
      • terminated == onError || onComplete
      • cancelled == cancel
      • disposed == terminated || cancelled
    • Deprecated FluxSink.serialize() since now Flux.create default to serialize (see #456), use of Flux.push can now be used alternatively for optimized single-producer push sources.
    • Aligned all error delaying aliases under combinatory conditions (merge, zip etc) to a suffixed alias standard xxxDelayError. In 3.1 we look forward giving subscribe-time option to override this behavior if the non suffixed operator alias is used. (see #480).
  • Default timed operator Scheduler is now Schedulers.parallel, note that thread-name will now vary between the number of workers as in parallel-x instead of a single timed-n. (see 93a08ae)

Avoiding deprecated API now as documented in javadoc will significantly reduce the burden of updating to 3.1. We track most of the deprecated APIs marked for deletion in 3.1 in #323.

✨ New features and improvements

  • Avoid unnecessary cancel events on onNext in Mono Subscribers such as operators or terminal subscribe/block calls. (see #442)
  • Add Flux/Mono Duration + Scheduler aliases (see #436)
  • Add FluxSink and MonoSink onCancel(Disposable) and onDispose(Disposable) (see #450, #444).
  • Add Scannable to query reactor component stateful graphs (see #249).
  • Add Flux.push for single producer, push-only alternative to Flux.create (see #456).
  • Flux.create is now "serialized by default" and allows for multi producer push (see #456).
  • Add FluxSink.onRequest(LongConsumer) to notify producer of downstream requests (see #456).
  • Add Mono.whenDelayError(Iterable) (see #470)
  • Add Mono.untilOther(Publisher) to coordinate on another Publisher (see #465)
  • Add Flux/Mono filterWhen(Function<T, Publisher<Boolean>>> for async filtering (see #498)

πŸͺ² Bug fixes

  • Fix Flux.windowWhile replenishing issue (see #477)
  • Fix Flux.concatMap prefetch to unbounded when used with Integer.MAX_VALUE (see #476)
  • Fix Mono.fromRunnable fusion issue that resulted in no runnable invoked (see #455)
  • Fix Flux/Mono.publish(Function) ArrayOutOfBoundsException (see #438)
  • Fix Schedulers.fromExecutorService(mayInterruptIfNeeded) issue where interrupt option was ignored (see #443)
  • Throwable.addSuppressed is now protected against circle reference in error handling (see #439)
  • Fix TopicProcessor silently failing on backlog size == 1 (see #445)
  • Fix Flux.flatMapIterable termination issue (see #453)
  • Fix BaseSubscriber.dispose to actually cancel upstream (see #461)

πŸ“– Documentation, Tests and Build

  • Added some advanced use documentation (see #505)

πŸ‘ Thanks to the following contributors that also participated to this release !

@lhotari @madhead @RunninglVlan @bdavisx @nebhale

A warm welcome to @rajinisivaram as our new internal contributor. You might already have noticed her name as she is also working on the awesome https://github.com/reactor/reactor-kafka.

Finally a massive thank you to our resident reactive doctor @akarnokd and his support in various design issues, lately on the new filterWhenoperator.