Skip to content

Commit 14f82de

Browse files
1.0.13
1 parent 1877fa7 commit 14f82de

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

CHANGES.md

+127
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,132 @@
11
# RxJava Releases #
22

3+
### Version 1.0.13 – July 20th 2015 ([Maven Central](http://search.maven.org/#artifactdetails%7Cio.reactivex%7Crxjava%7C1.0.13%7C)) ###
4+
5+
This release has quite a few bug fixes and some new functionality. Items of note are detailed here with the list of changes at the bottom.
6+
7+
##### merge
8+
9+
The `merge` operator went through a major rewrite to fix some edge case bugs in the previous version. This has been sitting for months going through review and performance testing due to the importance and ubiquity of its usage. It is believed this rewrite is now production ready and achieves the goal of being more correct (no known edge cases at this time) while retaining comparable performance and memory usage.
10+
11+
Special thanks to @akarnokd for this as `merge` is a challenging one to implement.
12+
13+
##### window fix and behavior change
14+
15+
Unsubscription bugs were fixed in `window`. Along the way it also resulted in a fix to one of the `window` overloads that had a functional discrepancy.
16+
17+
```java
18+
window(Func0<? extends Observable<? extends TClosing>> closingSelector)
19+
```
20+
21+
This is a small behavior change that corrects it. If you use this overload, please review the change to ensure your application is not affected by an assumption of the previously buggy behavior: https://github.com/ReactiveX/RxJava/pull/3039
22+
23+
Note that this behavior change only affects that particular overload while the broader bug fixes affect all `window` overloads.
24+
25+
##### rx.Single
26+
27+
After [much discussion](https://github.com/ReactiveX/RxJava/issues/1594) it was decided to add a new type to represent an `Observable` that emits a single item. Much bike-shedding led to the name `Single`. This was chosen because `Future`, `Promise` and `Task` are overused and already have nuanced connotations that differ from `rx.Single`, and we didn't want long, obnoxious names with `Observable` as a prefix or suffix. Read the issue thread if you want to dig into the long debates.
28+
29+
If you want to understand the reasoning behind adding this type, you can read about it [in this comment](https://github.com/ReactiveX/RxJava/issues/1594#issuecomment-101300655).
30+
31+
In short, request/response semantics are so common that it was decided worth creating a type that composes well with an `Observable` but only exposes request/response. The difference in behavior and comparability was also deemed worth having an alternative to `Future`. In particular, a `Single` is lazy whereas `Future` is eager. Additionally, merging of `Single`s becomes an `Observable`, whereas combining `Future`s always emits another `Future`.
32+
33+
Note that the API is added in an `@Experimental` state. We are fairly confident this will stick around, but are holding final judgement until it is used more broadly. We will promote to a stable API in v1.1 or v1.2.
34+
35+
Examples below demonstrate use of `Single`.
36+
37+
```java
38+
// Hello World
39+
Single<String> hello = Single.just("Hello World!");
40+
hello.subscribe(System.out::println);
41+
42+
// Async request/response
43+
Single<String> one = getData(1);
44+
Single<String> two = getOtherData(2);
45+
46+
// merge request/responses into an Observable of multiple values (not possible with Futures)
47+
Observable<String> merged = one.mergeWith(two);
48+
49+
// zip request/responses into another Single (similar to combining 2 Futures)
50+
Single<String> zipped = one.zipWith(two, (a, b) -> a + b);
51+
52+
// flatMap to a Single
53+
Single<String> flatMapSingle = one.flatMap(v -> {
54+
return getOtherData(5);
55+
});
56+
57+
// flatMap to an Observable
58+
Observable<Integer> flatMapObservable = one.flatMapObservable(v -> {
59+
return Observable.just(1, 2, 3);
60+
});
61+
62+
// toObservable
63+
Observable<String> toObservable = one.toObservable();
64+
65+
// toSingle
66+
Single<Integer> toSingle = Observable.just(1).toSingle();
67+
68+
public static Single<String> getData(int id) {
69+
return Single.<String> create(s -> {
70+
// do blocking IO
71+
s.onSuccess("data_" + id);
72+
}).subscribeOn(Schedulers.io());
73+
}
74+
75+
public static Single<String> getOtherData(int id) {
76+
return Single.<String> create(s -> {
77+
// simulate non-blocking IO
78+
new Thread(() -> {
79+
try {
80+
s.onSuccess("other_" + id);
81+
} catch (Exception e) {
82+
s.onError(e);
83+
}
84+
}).start();
85+
});
86+
}
87+
```
88+
89+
##### ConnectableObservable.autoConnect
90+
91+
A new feature was added to `ConnectableObservable` similar in behavior to `refCount()`, except that it doesn't disconnect when subscribers are lost. This is useful in triggering an "auto connect" once a certain number of subscribers have subscribed.
92+
93+
The [JavaDocs](https://github.com/ReactiveX/RxJava/blob/1877fa7bbc176029bcb5af00d8a7715dfbb6d373/src/main/java/rx/observables/ConnectableObservable.java#L96) and [unit tests](https://github.com/ReactiveX/RxJava/blob/1.x/src/test/java/rx/observables/ConnectableObservableTest.java) are good places to understand the feature.
94+
95+
##### Deprecated onBackpressureBlock
96+
97+
The `onBackpressureBlock` operator has been deprecated. It will not ever be removed during the 1.x lifecycle, but it is recommended to not use it. It has proven to be a common source of deadlocks and is difficult to debug. It is instead recommended to use non-blocking approaches to backpressure, rather than callstack blocking. Approaches to backpressure and flow control are [discussed on the wiki](https://github.com/ReactiveX/RxJava/wiki/Backpressure).
98+
99+
#### Changes
100+
101+
* [Pull 3012] (https://github.com/ReactiveX/RxJava/pull/3012) rx.Single
102+
* [Pull 2983] (https://github.com/ReactiveX/RxJava/pull/2983) Fixed multiple calls to onStart.
103+
* [Pull 2970] (https://github.com/ReactiveX/RxJava/pull/2970) Deprecated onBackpressureBlock
104+
* [Pull 2997] (https://github.com/ReactiveX/RxJava/pull/2997) Fix retry() race conditions
105+
* [Pull 3028] (https://github.com/ReactiveX/RxJava/pull/3028) Delay: error cut ahead was not properly serialized
106+
* [Pull 3042] (https://github.com/ReactiveX/RxJava/pull/3042) add backpressure support for defaultIfEmpty()
107+
* [Pull 3049] (https://github.com/ReactiveX/RxJava/pull/3049) single: add toSingle method to Observable
108+
* [Pull 3055] (https://github.com/ReactiveX/RxJava/pull/3055) toSingle() should use unsafeSubscribe
109+
* [Pull 3023] (https://github.com/ReactiveX/RxJava/pull/3023) ConnectableObservable autoConnect operator
110+
* [Pull 2928] (https://github.com/ReactiveX/RxJava/pull/2928) Merge and MergeMaxConcurrent unified and rewritten
111+
* [Pull 3039] (https://github.com/ReactiveX/RxJava/pull/3039) Window with Observable: fixed unsubscription and behavior
112+
* [Pull 3045] (https://github.com/ReactiveX/RxJava/pull/3045) ElementAt request management enhanced
113+
* [Pull 3048] (https://github.com/ReactiveX/RxJava/pull/3048) CompositeException extra NPE protection
114+
* [Pull 3052] (https://github.com/ReactiveX/RxJava/pull/3052) Reduce test failure likelihood of testMultiThreadedWithNPEinMiddle
115+
* [Pull 3031] (https://github.com/ReactiveX/RxJava/pull/3031) Fix OperatorFlatMapPerf.flatMapIntPassthruAsync Perf Test
116+
* [Pull 2975] (https://github.com/ReactiveX/RxJava/pull/2975) Deprecate and rename two timer overloads to interval
117+
* [Pull 2982] (https://github.com/ReactiveX/RxJava/pull/2982) TestSubscriber - add factory methods
118+
* [Pull 2995] (https://github.com/ReactiveX/RxJava/pull/2995) switchOnNext - ensure initial requests additive and fix request overflow
119+
* [Pull 2972] (https://github.com/ReactiveX/RxJava/pull/2972) Fixed window(time) to work properly with unsubscription, added
120+
* [Pull 2990] (https://github.com/ReactiveX/RxJava/pull/2990) Improve Subscriber readability
121+
* [Pull 3018] (https://github.com/ReactiveX/RxJava/pull/3018) TestSubscriber - fix awaitTerminalEventAndUnsubscribeOnTimeout
122+
* [Pull 3034] (https://github.com/ReactiveX/RxJava/pull/3034) Instantiate EMPTY lazily
123+
* [Pull 3033] (https://github.com/ReactiveX/RxJava/pull/3033) takeLast() javadoc fixes, standardize parameter names (count instead of num)
124+
* [Pull 3043] (https://github.com/ReactiveX/RxJava/pull/3043) TestSubscriber javadoc cleanup
125+
* [Pull 3065] (https://github.com/ReactiveX/RxJava/pull/3065) add Subscribers.wrap
126+
* [Pull 3091] (https://github.com/ReactiveX/RxJava/pull/3091) Fix autoConnect calling onStart twice.
127+
* [Pull 3092] (https://github.com/ReactiveX/RxJava/pull/3092) Single.toObservable
128+
129+
3130
### Version 1.0.12 – June 9th 2015 ([Maven Central](http://search.maven.org/#artifactdetails%7Cio.reactivex%7Crxjava%7C1.0.12%7C)) ###
4131

5132
* [Pull 2963] (https://github.com/ReactiveX/RxJava/pull/2963) Set of standard producers and updated queue implementations

0 commit comments

Comments
 (0)