Skip to content

Commit 17529d0

Browse files
committed
(#1230) javadocs for serialize()
also some improvements to javadocs for share()
1 parent 1e07ccc commit 17529d0

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5318,24 +5318,36 @@ public final <R> Observable<R> scan(R initialValue, Func2<R, ? super T, R> accum
53185318
}
53195319

53205320
/*
5321+
* Forces an Observable to make synchronous calls and to be well-behaved.
5322+
* <p>
5323+
* It is possible for an Observable to invoke its Subscribers' methods asynchronously, perhaps in different
5324+
* threads. This could make an Observable poorly-behaved, in that it might invoke {@code onCompleted} or
5325+
* {@code onError} before one of its {@code onNext} invocations. You can force such an Observable to be
5326+
* well-behaved and synchronous by applying the {@code serialize()} method to it.
5327+
* <p>
5328+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/synchronize.png">
5329+
*
5330+
* @return a {@link Observable} that is guaranteed to be well-behaved and synchronous
5331+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#serialize">RxJava Wiki: serialize()</a>
53215332
* @since 0.17
53225333
*/
53235334
public final Observable<T> serialize() {
53245335
return lift(new OperatorSerialize<T>());
53255336
}
53265337

53275338
/**
5328-
* Returns a new {@link Observable} that multicasts (shares) the original {@link Observable}.
5329-
* As long as there is more than 1 {@link Subscriber} this {@link Observable} will be subscribed and emitting data.
5339+
* Returns a new {@link Observable} that multicasts (shares) the original {@link Observable}. As long as
5340+
* there is more than 1 {@link Subscriber} this {@link Observable} will be subscribed and emitting data.
53305341
* When all subscribers have unsubscribed it will unsubscribe from the source {@link Observable}.
53315342
* <p>
53325343
* This is an alias for {@link #publish().refCount()}.
53335344
* <p>
5334-
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishConnect.png">
5345+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishRefCount.png">
53355346
*
53365347
* @return a {@link Observable} that upon connection causes the source Observable to emit items
53375348
* to its {@link Observer}s
5338-
* @see <a href="https://github.com/Netflix/RxJava/wiki/Connectable-Observable-Operators#wiki-observablepublish-and-observablemulticast">RxJava Wiki: publish()</a>
5349+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Connectable-Observable-Operators#connectableobservablerefcount">RxJava Wiki: refCount()</a>
5350+
* @since 0.19
53395351
*/
53405352
public final Observable<T> share() {
53415353
return publish().refCount();

0 commit comments

Comments
 (0)