Skip to content

Commit 50b618e

Browse files
committed
Add note to javadocs about ConnectableObservables requiring connect() call (ReactiveX#1180)
1 parent 6c336e0 commit 50b618e

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

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

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,7 +4299,9 @@ public final <TIntermediate, TResult> Observable<TResult> multicast(
42994299

43004300
/**
43014301
* Returns a {@link ConnectableObservable} that upon connection causes the source Observable to push results
4302-
* into the specified subject.
4302+
* into the specified subject. A Connectable Observable resembles an ordinary Observable, except that it
4303+
* does not begin emitting items when it is subscribed to, but only when its <code>connect()</code> method
4304+
* is called.
43034305
*
43044306
* @param subject
43054307
* the {@link Subject} for the {@link ConnectableObservable} to push source items into
@@ -4506,8 +4508,9 @@ public final <R> Observable<R> parallel(final Func1<Observable<T>, Observable<R>
45064508
}
45074509

45084510
/**
4509-
* Returns a {@link ConnectableObservable}, which waits until its {@link ConnectableObservable#connect connect} method is called before it begins emitting items to those {@link Observer}s that
4510-
* have subscribed to it.
4511+
* Returns a {@link ConnectableObservable}, which waits until its
4512+
* {@link ConnectableObservable#connect connect} method is called before it begins emitting items to those
4513+
* {@link Observer}s that have subscribed to it.
45114514
* <p>
45124515
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishConnect.png">
45134516
*
@@ -4569,7 +4572,9 @@ public final Subject<T, T> call() {
45694572
}
45704573

45714574
/**
4572-
* Returns an Observable that emits {@code initialValue} followed by the items emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable.
4575+
* Returns a {@link ConnectableObservable} that emits {@code initialValue} followed by the items emitted by
4576+
* the source Observable. A Connectable Observable resembles an ordinary Observable, except that it does not
4577+
* begin emitting items when it is subscribed to, but only when its <code>connect()</code> method is called.
45734578
* <p>
45744579
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishConnect.i.png">
45754580
*
@@ -4584,6 +4589,8 @@ public final ConnectableObservable<T> publish(T initialValue) {
45844589

45854590
/**
45864591
* Returns a {@link ConnectableObservable} that emits only the last item emitted by the source Observable.
4592+
* A Connectable Observable resembles an ordinary Observable, except that it does not begin emitting items
4593+
* when it is subscribed to, but only when its <code>connect()</code> method is called.
45874594
* <p>
45884595
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishLast.png">
45894596
*
@@ -4745,7 +4752,9 @@ public final Observable<T> repeat(long count, Scheduler scheduler) {
47454752

47464753
/**
47474754
* Returns a {@link ConnectableObservable} that shares a single subscription to the underlying Observable
4748-
* that will replay all of its items and notifications to any future {@link Observer}.
4755+
* that will replay all of its items and notifications to any future {@link Observer}. A Connectable
4756+
* Observable resembles an ordinary Observable, except that it does not begin emitting items when it is
4757+
* subscribed to, but only when its <code>connect()</code> method is called.
47494758
* <p>
47504759
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.png">
47514760
*
@@ -4998,7 +5007,9 @@ public final Subject<T, T> call() {
49985007

49995008
/**
50005009
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable that
5001-
* replays at most {@code bufferSize} items emitted by that Observable.
5010+
* replays at most {@code bufferSize} items emitted by that Observable. A Connectable Observable resembles
5011+
* an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only
5012+
* when its <code>connect()</code> method is called.
50025013
* <p>
50035014
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.n.png">
50045015
*
@@ -5015,7 +5026,9 @@ public final ConnectableObservable<T> replay(int bufferSize) {
50155026

50165027
/**
50175028
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
5018-
* replays at most {@code bufferSize} items that were emitted during a specified time window.
5029+
* replays at most {@code bufferSize} items that were emitted during a specified time window. A Connectable
5030+
* Observable resembles an ordinary Observable, except that it does not begin emitting items when it is
5031+
* subscribed to, but only when its <code>connect()</code> method is called.
50195032
* <p>
50205033
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.nt.png">
50215034
*
@@ -5036,7 +5049,9 @@ public final ConnectableObservable<T> replay(int bufferSize, long time, TimeUnit
50365049

50375050
/**
50385051
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
5039-
* that replays a maximum of {@code bufferSize} items that are emitted within a specified time window.
5052+
* that replays a maximum of {@code bufferSize} items that are emitted within a specified time window. A
5053+
* Connectable Observable resembles an ordinary Observable, except that it does not begin emitting items
5054+
* when it is subscribed to, but only when its <code>connect()</code> method is called.
50405055
* <p>
50415056
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.nts.png">
50425057
*
@@ -5064,7 +5079,9 @@ public final ConnectableObservable<T> replay(int bufferSize, long time, TimeUnit
50645079

50655080
/**
50665081
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
5067-
* replays at most {@code bufferSize} items emitted by that Observable.
5082+
* replays at most {@code bufferSize} items emitted by that Observable. A Connectable Observable resembles
5083+
* an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only
5084+
* when its <code>connect()</code> method is called.
50685085
* <p>
50695086
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.ns.png">
50705087
*
@@ -5085,7 +5102,9 @@ public final ConnectableObservable<T> replay(int bufferSize, Scheduler scheduler
50855102

50865103
/**
50875104
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
5088-
* replays all items emitted by that Observable within a specified time window.
5105+
* replays all items emitted by that Observable within a specified time window. A Connectable Observable
5106+
* resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to,
5107+
* but only when its <code>connect()</code> method is called.
50895108
* <p>
50905109
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.t.png">
50915110
*
@@ -5104,7 +5123,9 @@ public final ConnectableObservable<T> replay(long time, TimeUnit unit) {
51045123

51055124
/**
51065125
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
5107-
* replays all items emitted by that Observable within a specified time window.
5126+
* replays all items emitted by that Observable within a specified time window. A Connectable Observable
5127+
* resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to,
5128+
* but only when its <code>connect()</code> method is called.
51085129
* <p>
51095130
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.ts.png">
51105131
*
@@ -5125,7 +5146,9 @@ public final ConnectableObservable<T> replay(long time, TimeUnit unit, Scheduler
51255146

51265147
/**
51275148
* Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable that
5128-
* will replay all of its items and notifications to any future {@link Observer} on the given {@link Scheduler}.
5149+
* will replay all of its items and notifications to any future {@link Observer} on the given
5150+
* {@link Scheduler}. A Connectable Observable resembles an ordinary Observable, except that it does not
5151+
* begin emitting items when it is subscribed to, but only when its <code>connect()</code> method is called.
51295152
* <p>
51305153
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/replay.s.png">
51315154
*

0 commit comments

Comments
 (0)