본문

171214(목) - RxJava2 (defer)

RxJava2


defer

@CheckReturnValue
 @BackpressureSupport(value=PASS_THROUGH)
 @SchedulerSupport(value="none")
public static <T> Flowable<T> defer(java.util.concurrent.Callable<? extends Publisher<? extends T>> supplier)
Returns a Flowable that calls a Publisher factory to create a Publisher for each new Subscriber that subscribes. That is, for each subscriber, the actual Publisher that subscriber observes is determined by the factory function.

The defer Subscriber allows you to defer or delay emitting items from a Publisher until such time as an Subscriber subscribes to the Publisher. This allows a Subscriber to easily obtain updates or a refreshed version of the sequence.

Backpressure:
The operator itself doesn't interfere with backpressure which is determined by the Publisher returned by the supplier.
Scheduler:
defer does not operate by default on a particular Scheduler.
Type Parameters:
T - the type of the items emitted by the Publisher
Parameters:
supplier - the Publisher factory function to invoke for each Subscriber that subscribes to the resulting Publisher
Returns:
a Flowable whose Subscribers' subscriptions trigger an invocation of the given Publisher factory function
See Also:
ReactiveX operators documentation: Defer


'Mobile > RxJava2' 카테고리의 다른 글

RxJava2 (from)  (0) 2017.12.18
171215(금) - RxJava2 (empty/never/error)  (0) 2017.12.15
171213(수) - RxJava2 (create)  (0) 2017.12.13
171211(월) - @Volatile  (0) 2017.12.11
171211(월) - @Target  (0) 2017.12.11

공유

댓글