Skip to content

Commit f9d3e99

Browse files
committed
enhance Observable.fromCallable javadoc
1 parent aef6b96 commit f9d3e99

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/rx/Observable.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,22 +1251,26 @@ public final static <T> Observable<T> from(T[] array) {
12511251
}
12521252

12531253
/**
1254-
* Returns an Observable that invokes passed function and emits its result for each new Observer that subscribes.
1254+
* Returns an Observable that, when an observer subscribes to it, invokes a function you specify and then
1255+
* emits the value returned from that function.
12551256
* <p>
1256-
* Allows you to defer execution of passed function until Observer subscribes to the Observable.
1257-
* It makes passed function "lazy".
1258-
* Result of the function invocation will be emitted by the Observable.
1257+
* <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromCallable.png" alt="">
1258+
* <p>
1259+
* This allows you to defer the execution of the function you specify untl an observer subscribes to the
1260+
* Observable. That is to say, it makes the function "lazy."
12591261
* <dl>
12601262
* <dt><b>Scheduler:</b></dt>
12611263
* <dd>{@code fromCallable} does not operate by default on a particular {@link Scheduler}.</dd>
12621264
* </dl>
12631265
*
12641266
* @param func
1265-
* function which execution should be deferred, it will be invoked when Observer will subscribe to the Observable
1267+
* a function, the execution of which should be deferred; {@code fromCallable} will invoke this
1268+
* function only when an observer subscribes to the Observable that {@code fromCallable} returns
12661269
* @param <T>
12671270
* the type of the item emitted by the Observable
12681271
* @return an Observable whose {@link Observer}s' subscriptions trigger an invocation of the given function
12691272
* @see #defer(Func0)
1273+
* @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
12701274
*/
12711275
@Experimental
12721276
public static <T> Observable<T> fromCallable(Callable<? extends T> func) {

0 commit comments

Comments
 (0)