Skip to content

Commit 5d3b5e6

Browse files
author
Kaushik Gopal
committed
feat: update README with timing demos
1 parent 4feeb5f commit 5d3b5e6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ Using concat, you can retrieve information from an observable first (presumably
9090

9191
For the purposes of illustration i use an in-memory `List` (not an actual disk cache), then shoot out a real network call to the github api so it gives you a feel of how this can really be applied in production apps.
9292

93+
### Simple Timing demos using timer/interval/delay
94+
95+
This is a super simple and straightforward example which shows you how to use RxJava's `timer`, `interval` and `delay` operators to handle a bunch of cases where you want to run a task at specific intervals. Basically say NO to Android `TimerTask`s.
96+
97+
Cases demonstrated here:
98+
99+
1. run a single task after a delay of 2s, then complete
100+
2. run a task constantly every 1s (there's a delay of 1s before the first task fires off)
101+
3. run a task constantly every 1s (same as above but there's no delay before the first task fires off)
102+
4. run a task constantly every 3s, but after running it 5 times, terminate automatically
93103

94104
## Work in Progress:
95105

0 commit comments

Comments
 (0)