본문

180206(화) - RxJava2 (timer)

RxJava2 


timer


create an Observable that emits a particular item after a given delay

Timer

The Timer operator creates an Observable that emits one particular item after a span of time that you specify.


timer

@CheckReturnValue
 @BackpressureSupport(value=ERROR)
 @SchedulerSupport(value="io.reactivex:computation")
public static Flowable<java.lang.Long> timer(long delay,
                                                                                                                                                       java.util.concurrent.TimeUnit unit)
Returns a Flowable that emits 0L after a specified delay, and then completes.

Backpressure:
This operator does not support backpressure as it uses time. If the downstream needs a slower rate it should slow the timer or use something like onBackpressureDrop().
Scheduler:
timer operates by default on the computation Scheduler.
Parameters:
delay - the initial delay before emitting a single 0L
unit - time units to use for delay
Returns:
a Flowable that emits 0L after a specified delay, and then completes
See Also:
ReactiveX operators documentation: Timer

timer

@CheckReturnValue
 @BackpressureSupport(value=ERROR)
 @SchedulerSupport(value="custom")
public static Flowable<java.lang.Long> timer(long delay,
                                                                                                                                     java.util.concurrent.TimeUnit unit,
                                                                                                                                     Scheduler scheduler)
Returns a Flowable that emits 0L after a specified delay, on a specified Scheduler, and then completes.

Backpressure:
This operator does not support backpressure as it uses time. If the downstream needs a slower rate it should slow the timer or use something like onBackpressureDrop().
Scheduler:
You specify which Scheduler this operator will use.
Parameters:
delay - the initial delay before emitting a single 0L
unit - time units to use for delay
scheduler - the Scheduler to use for scheduling the item
Returns:
a Flowable that emits 0L after a specified delay, on a specified Scheduler, and then completes
See Also:
ReactiveX operators documentation: Timer


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

180315(목) - RxJava2 (concatMap)  (0) 2018.03.15
180107(수) - RxJava2 (buffer)  (0) 2018.02.07
180205(월) - RxJava2 (start)  (0) 2018.02.05
180104(목) - RxJava2 (repeat)  (0) 2018.01.04
180103(수) - RxJava2 (range)  (0) 2018.01.03

공유

댓글