본문

180104(목) - RxJava2 (repeat)

RxJava2


repeat


repeat

@CheckReturnValue
 @BackpressureSupport(value=FULL)
 @SchedulerSupport(value="none")
public final Flowable<T> repeat()
Returns a Flowable that repeats the sequence of items emitted by the source Publisher indefinitely.

Backpressure:
The operator honors downstream backpressure and expects the source Publisher to honor backpressure as well. If this expectation is violated, the operator may throw an IllegalStateException.
Scheduler:
repeat does not operate by default on a particular Scheduler.
Returns:
a Flowable that emits the items emitted by the source Publisher repeatedly and in sequence
See Also:
ReactiveX operators documentation: Repeat



repeat

@CheckReturnValue
 @BackpressureSupport(value=FULL)
 @SchedulerSupport(value="none")
public final Flowable<T> repeat(long times)
Returns a Flowable that repeats the sequence of items emitted by the source Publisher at most count times.

Backpressure:
The operator honors downstream backpressure and expects the source Publisher to honor backpressure as well. If this expectation is violated, the operator may throw an IllegalStateException.
Scheduler:
repeat does not operate by default on a particular Scheduler.
Parameters:
times - the number of times the source Publisher items are repeated, a count of 0 will yield an empty sequence
Returns:
a Flowable that repeats the sequence of items emitted by the source Publisher at most count times
Throws:
java.lang.IllegalArgumentException - if count is less than zero
See Also:
ReactiveX operators documentation: Repeat



repeatUntil

@CheckReturnValue
 @BackpressureSupport(value=FULL)
 @SchedulerSupport(value="none")
public final Flowable<T> repeatUntil(BooleanSupplier stop)
Returns a Flowable that repeats the sequence of items emitted by the source Publisher until the provided stop function returns true.

Backpressure:
The operator honors downstream backpressure and expects the source Publisher to honor backpressure as well. If this expectation is violated, the operator may throw an IllegalStateException.
Scheduler:
repeatUntil does not operate by default on a particular Scheduler.
Parameters:
stop - a boolean supplier that is called when the current Flowable completes and unless it returns false, the current Flowable is resubscribed
Returns:
the new Flowable instance
Throws:
java.lang.NullPointerException - if stop is null
See Also:
ReactiveX operators documentation: Repeat



repeatWhen

@CheckReturnValue
 @BackpressureSupport(value=FULL)
 @SchedulerSupport(value="none")
public final Flowable<T> repeatWhen(Function<? super Flowable<java.lang.Object>,? extends Publisher<?>> handler)
Returns a Flowable that emits the same values as the source Publisher with the exception of an onComplete. An onComplete notification from the source will result in the emission of a void item to the Publisher provided as an argument to the notificationHandler function. If that Publisher calls onComplete or onError then repeatWhen will call onComplete or onError on the child subscription. Otherwise, this Publisher will resubscribe to the source Publisher.

Backpressure:
The operator honors downstream backpressure and expects the source Publisher to honor backpressure as well. If this expectation is violated, the operator may throw an IllegalStateException.
Scheduler:
repeatWhen does not operate by default on a particular Scheduler.
Parameters:
handler - receives a Publisher of notifications with which a user can complete or error, aborting the repeat.
Returns:
the source Publisher modified with repeat logic
See Also:
ReactiveX operators documentation: Repeat


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

180206(화) - RxJava2 (timer)  (0) 2018.02.06
180205(월) - RxJava2 (start)  (0) 2018.02.05
180103(수) - RxJava2 (range)  (0) 2018.01.03
180102(화) - RxJava2 (Just)  (0) 2018.01.02
171225(월) - RxJava2 (interval)  (0) 2017.12.26

공유

댓글