Skip to main content

Command Palette

Search for a command to run...

Observable using timer

Published
1 min read

Observable with timer will delay the publishing the event to the the time specified. It can be used if you want the Observable to delay the publishing of source events for some time.
It will publish a Single element after the time specified.

Below logs will show that event is published after specified time of 5 seconds.

23-01-20 13:29:49 [main] [INFO ] [c.c.l.rxjava.observers.DemoObserver]- onSubscribe
23-01-20 13:29:54 [RxComputationThreadPool-1] [INFO ] [c.c.l.rxjava.observers.DemoObserver]- onNext -> 0
23-01-20 13:29:54 [RxComputationThreadPool-1] [INFO ] [c.c.l.rxjava.observers.DemoObserver]- onComplete
86 views

More from this blog

C

Coding Saint - Simple Short Tutorials

52 posts

I am Kumar Pallav, a passionate programmer.I love java, open source & microservices . I create Simple , Short Tutorials Follow me at https://twitter.com/kumar_pallav