diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java index 5a2c01db35..298ff10cef 100644 --- a/src/main/java/io/reactivex/Completable.java +++ b/src/main/java/io/reactivex/Completable.java @@ -394,6 +394,17 @@ public static Completable fromObservable(final ObservableSource observabl /** * Returns a Completable instance that subscribes to the given publisher, ignores all values and * emits only the terminal event. + *

+ * The {@link Publisher} must follow the + * Reactive-Streams specification. + * Violating the specification may result in undefined behavior. + *

+ * If possible, use {@link #create(CompletableOnSubscribe)} to create a + * source-like {@code Completable} instead. + *

+ * Note that even though {@link Publisher} appears to be a functional interface, it + * is not recommended to implement it through a lambda as the specification requires + * state management not achievable with a stateless lambda. *

*
Backpressure:
*
The returned {@code Completable} honors the backpressure of the downstream consumer @@ -405,6 +416,7 @@ public static Completable fromObservable(final ObservableSource observabl * @param publisher the Publisher instance to subscribe to, not null * @return the new Completable instance * @throws NullPointerException if publisher is null + * @see #create(CompletableOnSubscribe) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index d58c6faad8..4f174ef1a7 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -2094,6 +2094,17 @@ public static Flowable fromIterable(Iterable source) { /** * Converts an arbitrary Reactive-Streams Publisher into a Flowable if not already a * Flowable. + *

+ * The {@link Publisher} must follow the + * Reactive-Streams specification. + * Violating the specification may result in undefined behavior. + *

+ * If possible, use {@link #create(FlowableOnSubscribe, BackpressureStrategy)} to create a + * source-like {@code Flowable} instead. + *

+ * Note that even though {@link Publisher} appears to be a functional interface, it + * is not recommended to implement it through a lambda as the specification requires + * state management not achievable with a stateless lambda. *

*
Backpressure:
*
The operator is a pass-through for backpressure and its behavior is determined by the @@ -2105,6 +2116,7 @@ public static Flowable fromIterable(Iterable source) { * @param source the Publisher to convert * @return the new Flowable instance * @throws NullPointerException if publisher is null + * @see #create(FlowableOnSubscribe, BackpressureStrategy) */ @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index ab3f0689bf..ce0b2933e8 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -1897,6 +1897,17 @@ public static Observable fromIterable(Iterable source) { /** * Converts an arbitrary Reactive-Streams Publisher into an Observable. + *

+ * The {@link Publisher} must follow the + * Reactive-Streams specification. + * Violating the specification may result in undefined behavior. + *

+ * If possible, use {@link #create(ObservableOnSubscribe)} to create a + * source-like {@code Observable} instead. + *

+ * Note that even though {@link Publisher} appears to be a functional interface, it + * is not recommended to implement it through a lambda as the specification requires + * state management not achievable with a stateless lambda. *

*
Backpressure:
*
The source {@code publisher} is consumed in an unbounded fashion without applying any @@ -1908,6 +1919,7 @@ public static Observable fromIterable(Iterable source) { * @param publisher the Publisher to convert * @return the new Observable instance * @throws NullPointerException if publisher is null + * @see #create(ObservableOnSubscribe) */ @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @CheckReturnValue diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index 76b27aae6f..4cbe83a208 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -578,6 +578,17 @@ public static Single fromFuture(Future future, Scheduler sch * Wraps a specific Publisher into a Single and signals its single element or error. *

If the source Publisher is empty, a NoSuchElementException is signalled. If * the source has more than one element, an IndexOutOfBoundsException is signalled. + *

+ * The {@link Publisher} must follow the + * Reactive-Streams specification. + * Violating the specification may result in undefined behavior. + *

+ * If possible, use {@link #create(SingleOnSubscribe)} to create a + * source-like {@code Single} instead. + *

+ * Note that even though {@link Publisher} appears to be a functional interface, it + * is not recommended to implement it through a lambda as the specification requires + * state management not achievable with a stateless lambda. *

*
Backpressure:
*
The {@code publisher} is consumed in an unbounded fashion but will be cancelled @@ -588,6 +599,7 @@ public static Single fromFuture(Future future, Scheduler sch * @param the value type * @param publisher the source Publisher instance, not null * @return the new Single instance + * @see #create(SingleOnSubscribe) */ @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @CheckReturnValue