Skip to content

Commit b21c237

Browse files
committed
cache() now supports backpressure (again)
1 parent 921b7e2 commit b21c237

File tree

7 files changed

+930
-242
lines changed

7 files changed

+930
-242
lines changed

src/main/java/rx/Observable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,7 +3599,7 @@ public final <B> Observable<List<T>> buffer(Observable<B> boundary, int initialC
35993599
* @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
36003600
*/
36013601
public final Observable<T> cache() {
3602-
return create(new OnSubscribeCache<T>(this));
3602+
return CachedObservable.from(this);
36033603
}
36043604

36053605
/**
@@ -3634,7 +3634,7 @@ public final Observable<T> cache() {
36343634
* @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
36353635
*/
36363636
public final Observable<T> cache(int capacityHint) {
3637-
return create(new OnSubscribeCache<T>(this, capacityHint));
3637+
return CachedObservable.from(this, capacityHint);
36383638
}
36393639

36403640
/**

0 commit comments

Comments
 (0)