File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5324,6 +5324,23 @@ public final Observable<T> serialize() {
5324
5324
return lift (new OperatorSerialize <T >());
5325
5325
}
5326
5326
5327
+ /**
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.
5330
+ * When all subscribers have unsubscribed it will unsubscribe from the source {@link Observable}.
5331
+ * <p>
5332
+ * This is an alias for {@link #publish().refCount()}.
5333
+ * <p>
5334
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishConnect.png">
5335
+ *
5336
+ * @return a {@link Observable} that upon connection causes the source Observable to emit items
5337
+ * 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>
5339
+ */
5340
+ public final Observable <T > share () {
5341
+ return publish ().refCount ();
5342
+ }
5343
+
5327
5344
/**
5328
5345
* If the source Observable completes after emitting a single item, return an Observable that emits that
5329
5346
* item. If the source Observable emits more than one item or no items, throw an {@code NoSuchElementException}.
You can’t perform that action at this time.
0 commit comments