timer(delay::Int) timer(delay::Int, period::Int)
Creation operator for the
TimerObservable. Its like
interval(@ref), but you can specify when should the emissions start.
timer returns an Observable that emits an infinite sequence of ascending integers, with a constant interval of time, period of your choosing between those emissions. The first emission happens after the specified
period is not specified, the output Observable emits only one value, 0. Otherwise, it emits an infinite sequence.
delay: the initial delay time specified as an integer denoting milliseconds to wait before emitting the first value of 0.
period: the minimum period of time between emissions of the subsequent numbers (in milliseconds).
using Rocket source = timer(0, 50) sleep(0.075) subscription = subscribe!(source, logger()) sleep(0.105) unsubscribe!(subscription) close(source) ; # output [LogActor] Data: 2 [LogActor] Data: 3
An Observable that starts emitting after an
delay and emits ever increasing numbers after each
period of time thereafter.
delay: The initial delay time specified as an integer denoting milliseconds to wait before emitting the first value of 0`.
period: The minimum period of time in milliseconds between emissions of the subsequent numbers.