Skip to content

Releases: ReactiveX/RxJava

1.1.8

23 Jul 07:23

Choose a tag to compare

Version 1.1.8 - July 23, 2016 (Maven)

Bugfixes

  • Pull 4209: merge/flatMap to keep scalar/inner element relative order.
  • Pull 4215: Fix assembly tracking replacing original exception.
  • Pull 4229: fix replay() retaining reference to the child Subscriber

1.1.7

10 Jul 07:01

Choose a tag to compare

Version 1.1.7 - July 10, 2016 (Maven)

This release has several documentation fixes (AsyncSubject, doOnEach, cache, scan, reduce, backpressure descriptions) and internal cleanups based on tool feedback (code-coverage and PMD).

Warning: behavior change in the time-bound replay() operator: the aging of the values continues after the termination of the source and thus late subscribers no longer get old data. For example, a given just(1).replay(1, TimeUnit.MINUTE) a subscriber subscribing after 2 minutes won't get 1 but only onCompleted.

Warning: behavior change in timestamp() and timeInterval() (no arguments) operators: they now take timing information from the computation scheduler instead of the immediate scheduler. This change now allows hooking these operators' time source.

Warning: the parameter order of Completable.subscribe(onError, onComplete) has been changed to Completable.subscribe(onComplete, onError) to better match the callback order in the other base reactive classes, namely the most significant signal comes first (Observer.onNext, SingleSubscriber.onSuccess, and now CompletableSubscriber.onCompleted).

The new RxJavaHooks API

PR #4007 introduced a new way of hooking into the lifecycle of the base reactive types (Observable, Single, Completable) and the Schedulers. The original RxJavaPlugins' design was too much focused on class-initialization time hooking and didn't properly allow hooking up different behavior after that. There is a reset() available on it but sometimes that doesn't work as expected.

The new class rx.plugins.RxJavaHooks allows changing the hooks at runtime, allowing tests to temporarily hook onto an internal behavior and then un-hook once the test completed.

RxJavaHooks.setOnObservableCreate(s -> {
   System.out.println("Observable created");
   return s;
});

Observable.just(1).subscribe(System.out::println);

RxJavaHooks.reset();
// or
RxJavaHooks.setOnObservableCreate(null);

It is now also possible to override what Schedulers the Schedulers.computation(), .io() and .newThread() returns without the need to fiddle with Schedulers' own reset behavior:

RxJavaHooks.setOnComputationScheduler(current -> Schedulers.immediate());

Observable.just(1).subscribeOn(Schedulers.computation())
.subscribe(v -> System.out.println(Thread.currentThread()));

By default, all RxJavaHooks delegate to the original RxJavaPlugins callbacks so if you have hooks the old way, they still work. RxJavaHooks.reset() resets to this delegation and RxJavaHooks.clear() clears all hooks (i.e., everything becomes a pass-through hook).

API enhancements

  • Pull 3966: Add multi-other withLatestFrom operators.
  • Pull 3720: Add vararg of Subscriptions to composite subscription.
  • Pull 4034: distinctUntilChanged with direct value comparator - alternative.
  • Pull 4036: Added zip function with Observable array.
  • Pull 4020: Add AsyncCompletableSubscriber that exposes unsubscribe().
  • Pull 4011: Deprecate TestObserver, enhance TestSubscriber a bit.
  • Pull 4007: new hook management proposal
  • Pull 4173: allow customizing GenericScheduledExecutorService via RxJavaHooks
  • Pull 3931: add groupBy overload with evictingMapFactory
  • Pull 4140: Change Completable.subscribe(onError, onComplete) to (onComplete, onError)
  • Pull 4154: Ability to create custom schedulers with behavior based on composing operators via Scheduler.when.
  • Pull 4179: New fromAsync to bridge the callback world with the reactive.

API deprecations

  • Pull 4011: Deprecate TestObserver, enhance TestSubscriber a bit.
  • Pull 4007: new hook management proposal (deprecates some RxJavaPlugins methods).

Performance enhancements

  • Pull 4097: update map() and filter() to implement OnSubscribe directly.
  • Pull 4176: Optimize collect, reduce and takeLast(1)

Bugfixes

  • Pull 4027: fix Completable.onErrorComplete(Func1) not relaying function crash.
  • Pull 4051: fix ReplaySubject anomaly around caughtUp by disabling that optimization.

1.1.6

15 Jun 23:44

Choose a tag to compare

Version 1.1.6 - June 15, 2016 (Maven)

API enhancements

  • Pull 3934: TestSubscriber extra info on assertion failures
  • Pull 3948: add Completable.andThen(Completable)
  • Pull 3942: add Completable.subscribe to be safe, add unsafeSubscribe option + RxJavaPlugins hook support
  • Pull 3936: promote UnicastSubject to be a standard+experimental Subject
  • Pull 3971: add Observable.rebatchRequests operator to change and stabilize request amounts of the downstream.
  • Pull 3986: add Schedulers.reset() for better testing
  • Pull 3918: ReplaySubject now supports backpressure

API deprecations

  • Pull 3948 deprecate Completable.endWith() in favor of andThen()

Performance enhancements

  • Pull 3470: replay request coordination reduce overhead

Bugfixes

  • Pull 3924: fix RxRingBuffer-pool depending on the computation scheduler
  • Pull 3922: fix using() resource cleanup when factory throws or being non-eager
  • Pull 3941: fix Single.flatMap not composing subscription through
  • Pull 3958: fix just() construction to call the onCreate execution hook
  • Pull 3977: Use the correct Throwable to set the cause for CompositeException
  • Pull 4005: Fix Spsc queues reporting not empty but then poll() returns null.

1.1.5

05 May 20:06

Choose a tag to compare

Version 1.1.5 - May 5, 2016 (Maven)

Bugfixes

  • Pull 3912: fix filter() default-requesting and thus going unbounded

1.1.4

04 May 21:11

Choose a tag to compare

API enhancements

  • Pull 3856: Provide factories for creating the default scheduler instances.
  • Pull 3866: Add Single.toCompletable().
  • Pull 3879: Expose scheduler factories which accept thread factories.
  • Pull 3820: Making RxPlugins reset() public
  • Pull 3888: New operator: onTerminateDetach - detach upstream/downstream for GC

API deprecations

  • Pull 3871: Deprecate remaining public scheduler types.

Performance enhancements

  • Pull 3761: optimize merge/flatMap for empty sources.
  • Pull 3864: optimize concatMapIterable/flatMapIterable.

Bugfixes

  • Pull 3868: Fix an unsubscribe race in EventLoopWorker.
  • Pull 3867: ensure waiting tasks are cancelled on worker unsubscription.
  • Pull 3862: fix from(Iterable) error handling of Iterable/Iterator
  • Pull 3886: throwIfFatal() now throws OnCompletedFailedException.
  • Pull 3887: Have undeliverable errors on subscribe() sent to plugin error handler.
  • Pull 3895: cast() should unsubscribe on crash eagerly.
  • Pull 3896: OperatorMapPair should unsubscribe on crash eagerly.
  • Pull 3890: map() and filter() should unsubscribe on crash eagerly.
  • Pull 3893: enable backpressure with from(Future)
  • Pull 3883: fix multiple chained Single.doAfterTerminate not calling actions
  • Pull 3904: Fix Completable swallows OnErrorNotImplementedException
  • Pull 3905: fix singleOrDefault() backpressure if source is empty

1.1.3

08 Apr 22:26

Choose a tag to compare

API enhancements

  • Pull 3780: SyncOnSubscribe has been promoted to @Beta API.
  • Pull 3799: Added Completable.andThen(Single) operator
  • Pull 3777: Added observeOn overload to configure the prefetch/buffer size
  • Pull 3790: Make Single.lift public and @Experimental
  • Pull 3818: fromCallable promotion to @Beta
  • Pull 3842: improve ExecutorScheduler worker unsubscription

API deprecations

  • Pull 3762: Deprecate CompositeException constructor with message prefix

General enhancements

  • Pull 3828: AsyncSubject now supports backpressure
  • Pull 3829: Added rx.unsafe-disable system property to disable use of sun.misc.Unsafe even if it is available
  • Pull 3757: Warning: behavior change! Operator sample emits last sampled value before termination

Performance enhancements

  • Pull 3795: observeOn now replenishes with constant rate

Bugfixes

  • Pull 3809: fix merge/flatMap crash when the inner source was just(null)
  • Pull 3789: Prevent Single.zip() of zero Singles
  • Pull 3787: fix groupBy delaying group completion till all groups were emitted
  • Pull 3823: fix DoAfterTerminate handle if action throws
  • Pull 3822: make defensive copy of the properties in RxJavaPlugins
  • Pull 3836: fix switchMap/switchOnNext producer retention and backpressure
  • Pull 3840: fix concatMap scalar/empty source behavior
  • Pull 3839: fix takeLast() backpressure
  • Pull 3845: fix delaySubscription(Observable) unsubscription before triggered

Version 1.1.2 - March 18, 2016

18 Mar 22:24

Choose a tag to compare

API Enhancements

  • Pull 3766: Add Single.onErrorResumeNext(Func1) operator
  • Pull 3765: Add Observable.switchOnNextDelayError and Observable.switchMapDelayError operators
  • Pull 3759: Add Observable.concatDelayError and Observable.concatMapDelayError operators
  • Pull 3763: Add Observable.combineLatestDelayError operator
  • Pull 3752: Add Single.using operator
  • Pull 3722: Add Observable.flatMapIterable overload with maxConcurrent parameter
  • Pull 3741: Add Single.doOnSubscribe operator
  • Pull 3738: Add Observable.create(SyncOnSubscribe) and Observable.create(AsyncOnSubscribe) factory methods
  • Pull 3718: Add Observable.concatMapIterable operator
  • Pull 3712: Add Single.takeUntil(Completable) operator
  • Pull 3696: Added Single execution hooks via RxJavaSingleExecutionHook class. Warning! This PR introduced a binary incompatible change of Single.unsafeSubscribe(Subscriber) by changing its return type from void to Subscription.
  • Pull 3487: Add onBackpressureBuffer overflow strategies (oldest, newest, error)

API deprecations

  • Pull 3701: deprecate Completable.doOnComplete in favor of Completable.doOnCompleted (note the last d in the method name)

Performance enhancements

  • Pull 3759: Add Observable.concatDelayError and Observable.concatMapDelayError operators
  • Pull 3476: reduced range and flatMap/merge overhead

Bugfixes

  • Pull 3768: Fix observeOn in-sequence termination/unsubscription checking
  • Pull 3733: Avoid swallowing errors in Completable
  • Pull 3727: Fix scan not requesting Long.MAX_VALUE from upstream if downstream has requested Long.MAX_VALUE
  • Pull 3707: Lambda-based Completable.subscribe() methods should report isUnsubscribed properly
  • Pull 3702: Fix mapNotification backpressure handling
  • Pull 3697: Fix ScalarSynchronousObservable expecting the Scheduler.computation() to be EventLoopsScheduler all the time
  • Pull 3760: Fix ExecutorScheduler and GenericScheduledExecutorService reorder bug
  • Pull 3678: Fix counted buffer and window backpressure

1.1.1

11 Feb 20:59

Choose a tag to compare

Version 1.1.1 - February 11, 2016 (Maven)

The new Completable class

  • Pull 3444 Completable class to support valueless event composition + tests
What is this Completable class?

We can think of a Completable object as a stripped version of Observable where only the terminal events, onError and onCompleted are ever emitted; they may look like an Observable.empty() typified in a concrete class but unlike empty(), Completable is an active class. Completable mandates side effects when subscribed to and it is its main purpose indeed. Completable contains some deferred computation with side effects and only notifies about the success or failure of such computation.

Similar to Single, the Completable behavior can be emulated with Observable<?> to some extent, but many API designers think codifying the valuelessness in a separate type is more expressive than messing with wildcards (and usually type-variance problems) in an Observable chain.

Completable doesn't stream a single value, therefore, it doesn't need backpressure, simplifying the internal structure from one perspective, however, optimizing these internals requires more lock-free atomics knowledge in some respect.

Hello World!

Let's see how one can build a (side-effecting) Hello World Completable:

Completable.fromAction(() -> System.out.println("Hello World!"))
.subscribe();

Quite straightforward. We have a set of fromXXX method which can take many sources: Action, Callable, Single and even Observable (stripping any values generated by the latter 3 of course). On the receiving end, we have the usual subscribe capabilities: empty, lambdas for the terminal events, a rx.Subscriber and a rx.Completable.CompletableSubscriber, the main intended receiver for Completables.

Further reading

API enhancements

  • Pull 3434 Add Single.doAfterTerminate()
  • Pull 3447 operator DelaySubscription with plain Observable
  • Pull 3498 Rename cache(int) to cacheWithCapacityHint(int)
  • Pull 3539 Add Single.zip() for Iterable of Singles
  • Pull 3562 Add Single.doOnUnsubscribe()
  • Pull 3566 Deprecate Observable.finallyDo() and add Observable.doAfterTerminate() instead
  • Pull 3567 Implemented Observable#toCompletable
  • Pull 3570 Implemented Completable#andThen(Observable)
  • Pull 3627 Added MergeDelay operators for Iterable of Observables
  • Pull 3655 Add Single.onErrorResumeNext(Single)
  • Pull 3661 CombineLatest now supports any number of sources
  • Pull 3682 fix observeOn resource handling, add delayError capability
  • Pull 3686 Added retry and retryWhen support for Single

API deprecations

  • cache(int) via #3498, replaced by cacheWithCapacityHint(int)
  • finallyDo(Action0) via #3566, replaced by doAfterTerminate(Action0)

Performance improvements

  • Pull 3477 add a source OnSubscribe which works from an array directly
  • Pull 3579 No more need to convert Singles to Observables for Single.zip()
  • Pull 3587 Remove the need for javac to generate synthetic methods
  • Pull 3614 just() now supports backpressure
  • Pull 3642 Optimizate single just
  • Pull 3589 concat reduce overhead when streaming a source

Bugfixes

  • Pull 3428 GroupBy backpressure fix
  • Pull 3454 fix: bounded replay() not requesting enough for latecommers
  • Pull 3467 compensate for drastic clock drifts when scheduling periodic tasks
  • Pull 3555 fix toMap and toMultimap not handling exceptions of the callbacks
  • Pull 3585 fix Completable.using not disposing the resource if the factory crashes during the subscription phase
  • Pull 3588 Fix the initialization order in GenericScheduledExecutorService
  • Pull 3620 Fix NPE in CompositeException when nested throws on initCause
  • Pull 3630 ConcatMapEager allow nulls from inner Observables.
  • Pull 3637 handle predicate exceptions properly in skipWhile
  • Pull 3638 fix error handling in OperatorDistinctUntilChanged
  • Pull 3639 fix error handling in onBackpressureBuffer
  • Pull 3640 fix error handling in onBackpressureDrop
  • Pull 3644 fix SyncOnSubscribe not signalling onError if the generator crashes
  • Pull 3645 fix Amb sharing the choice among all subscribers
  • Pull 3653 fix sample(Observable) not requesting Long.MAX_VALUE
  • Pull 3658 fix unsubscription and producer issues in sample(other)
  • Pull 3662 fix doOnRequest premature requesting
  • Pull 3677 negative argument check for skip's count and merge's maxConcurrent
  • Pull 3681 change publish(Func1) to use a dedicated subject-like dispatcher
  • Pull 3688 Fix zip() - observer array becoming visible too early and causing NPE
  • Pull 3689 unified onErrorX and onExceptionResumeNext and fixed backpressure

1.1.0

03 Dec 20:42

Choose a tag to compare

Version 1.1.0 – December 2 2015 (Maven Central)

  • Pull 3550 Public API changes for 1.1.0 release

Promotions to Public API

  • Subscriptions.unsubscribed
  • Subscribers.wrap
  • 2 RxJavaErrorHandler methods
  • Single + SingleSubscriber
  • Exceptions.throwIfAny
  • Observable.switchIfEmpty with Observable
  • BackpressureDrainManager
  • Observable.onBackpressureLatest
  • Observable.onBackpressureDrop with action
  • Observable.onBackpressureBuffer overloads
  • 2 Observable.merge overloads for maxConcurrent
  • TestSubscriber methods
  • Observable.takeUntil with predicate

Promotions to BETA

  • ConnectableObservable.autoConnect
  • Stateful Subject methods on ReplaySubject, PublishSubject, BehaviorSubject, and AsyncSubject

Experimental APIs Removed

  • Observable.onBackpressureBlock
  • rx.observables.AbstractOnSubscribe
  • Removal of stateful methods from the generic rx.subjects.Subject abstract class

1.0.17

02 Dec 20:25

Choose a tag to compare

Version 1.0.17 – December 1 2015 (Maven Central)

  • Pull 3150 Window operators now support backpressure in the inner observable
  • Pull 3535 Don't swallow fatal errors in OperatorZipIterable
  • Pull 3528 Avoid to call next when Iterator is drained
  • Pull 3436 Add action != null check in OperatorFinally
  • Pull 3513 Add shorter RxJavaPlugin class lookup approach