GeezerVison is showing github.com — feat: update README with timing demos · ttylinux/Android-RxJava@5d3b5e6
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: README.md +10Lines changed: 10 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -90,6 +90,16 @@ Using concat, you can retrieve information from an observable first (presumably |
90 | 90 |
|
91 | 91 | 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. |
92 | 92 |
|
| 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 |
93 | 103 |
|
94 | 104 | ## Work in Progress: |
95 | 105 |
|
|