본문
171215(금) - RxJava2 (empty/never/error)
Mobile/RxJava2 2017. 12. 15. 10:09
RxJava2
empty/never/error
empty
@CheckReturnValue @BackpressureSupport(value=PASS_THROUGH) @SchedulerSupport(value="none") public static <T> Flowable<T> empty()
Returns a Flowable that emits no items to the
Subscriber and immediately invokes its onComplete method.
- Backpressure:
- This source doesn't produce any elements and effectively ignores downstream backpressure.
- Scheduler:
emptydoes not operate by default on a particularScheduler.
- Type Parameters:
T- the type of the items (ostensibly) emitted by the Publisher- Returns:
- a Flowable that emits no items to the
Subscriberbut immediately invokes theSubscriber'sonCompletemethod - See Also:
- ReactiveX operators documentation: Empty
never
@CheckReturnValue @BackpressureSupport(value=PASS_THROUGH) @SchedulerSupport(value="none") public static <T> Flowable<T> never()
Returns a Flowable that never sends any items or notifications to a
Subscriber.
This Publisher is useful primarily for testing purposes.
- Backpressure:
- This source doesn't produce any elements and effectively ignores downstream backpressure.
- Scheduler:
neverdoes not operate by default on a particularScheduler.
- Type Parameters:
T- the type of items (not) emitted by the Publisher- Returns:
- a Flowable that never emits any items or sends any notifications to a
Subscriber - See Also:
- ReactiveX operators documentation: Never
error
@CheckReturnValue @BackpressureSupport(value=PASS_THROUGH) @SchedulerSupport(value="none") public static <T> Flowable<T> error(java.util.concurrent.Callable<? extends java.lang.Throwable> supplier)
Returns a Flowable that invokes a
Subscriber's onError method when the Subscriber subscribes to it.
- Backpressure:
- This source doesn't produce any elements and effectively ignores downstream backpressure.
- Scheduler:
errordoes not operate by default on a particularScheduler.
- Type Parameters:
T- the type of the items (ostensibly) emitted by the Publisher- Parameters:
supplier- a Callable factory to return a Throwable for each individual Subscriber- Returns:
- a Flowable that invokes the
Subscriber'sonErrormethod when the Subscriber subscribes to it - See Also:
- ReactiveX operators documentation: Throw
@CheckReturnValue @BackpressureSupport(value=PASS_THROUGH) @SchedulerSupport(value="none") public static <T> Flowable<T> error(java.lang.Throwable throwable)
Returns a Flowable that invokes a
Subscriber's onError method when the Subscriber subscribes to it.
- Backpressure:
- This source doesn't produce any elements and effectively ignores downstream backpressure.
- Scheduler:
errordoes not operate by default on a particularScheduler.
- Type Parameters:
T- the type of the items (ostensibly) emitted by the Publisher- Parameters:
throwable- the particular Throwable to pass toonError- Returns:
- a Flowable that invokes the
Subscriber'sonErrormethod when the Subscriber subscribes to it - See Also:
- ReactiveX operators documentation: Throw
'Mobile > RxJava2' 카테고리의 다른 글
| 171225(월) - RxJava2 (interval) (0) | 2017.12.26 |
|---|---|
| RxJava2 (from) (0) | 2017.12.18 |
| 171214(목) - RxJava2 (defer) (0) | 2017.12.14 |
| 171213(수) - RxJava2 (create) (0) | 2017.12.13 |
| 171211(월) - @Volatile (0) | 2017.12.11 |
댓글