public class ResettableInterval extends Object
start(Duration, Duration) and will continue until
stop() is called or start(Duration, Duration) is re-invoked, resetting the previous emitter.
The ticks are available from the ticks() method.| Constructor and Description |
|---|
ResettableInterval(Scheduler scheduler)
Create a
ResettableInterval that emits ticks on the given Scheduler upon calling
start(Duration, Duration). |
| Modifier and Type | Method and Description |
|---|---|
void |
start(Duration delay,
Duration period)
Begin producing ticks at the given rate.
|
void |
stop()
Dispose the current emitter task without completing or cancelling existing subscriptions to
ticks(). |
Flux<Long> |
ticks()
Return a
Flux that emits ticks at the currently configured rate. |
public ResettableInterval(Scheduler scheduler)
ResettableInterval that emits ticks on the given Scheduler upon calling
start(Duration, Duration).scheduler - the Reactor Scheduler to use to emit tickspublic void start(Duration delay, Duration period)
delay - the Duration to wait before emitting the first tickperiod - the period Duration used to emit ticks.Flux.interval(Duration, Duration, Scheduler)public void stop()
ticks().public Flux<Long> ticks()
Flux that emits ticks at the currently configured rate.Flux of increasing values since the last start(Duration, Duration) call