Skip to main content

Observable using timer

Updated 1 min readMarkdown
Part of seriesJava

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

About the author

  • DigitalYogi builds interactive System Design (HLD), Low-Level Design (LLD), Visual DSA & Spring AI playbooks for working Java backend engineers. Workbench: kb.digitalyogi.tech · Free 12-sheet templates: learn.digitalyogi.tech/system

No comments yet. Be the first to comment.

Java

Part 7 of 11

Java needs no introduction. Let's learn java . JAVA is easy.

Up nextJava: Text Block (JEP 378)Easier & Readable Strings

More from this blog