Skip to content

Commit dcbcf8a

Browse files
committed
CustomReplaySubject to support various replay() operators.
1 parent ccf921b commit dcbcf8a

File tree

3 files changed

+825
-0
lines changed

3 files changed

+825
-0
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,6 +4278,19 @@ public ConnectableObservable<T> replay() {
42784278
return OperationMulticast.multicast(this, ReplaySubject.<T> create());
42794279
}
42804280

4281+
/**
4282+
* Returns a {@link ConnectableObservable} that shares a single subscription
4283+
* to the underlying Observable that will replay all of its items and
4284+
* notifications to any future {@link Observer} on the given scheduler
4285+
*
4286+
* @param scheduler
4287+
* @return
4288+
*
4289+
* @see <a href='http://msdn.microsoft.com/en-us/library/hh211699.aspx'>MSDN: Observable.Replay</a>
4290+
*/
4291+
public ConnectableObservable<T> replay(Scheduler scheduler) {
4292+
return OperationMulticast.multicast(this, ReplaySubject.<T> create());
4293+
}
42814294
/**
42824295
* Retry subscription to the source Observable when it calls
42834296
* <code>onError</code> up to a certain number of retries.

0 commit comments

Comments
 (0)