https://github.com/memoizr/rx-experiments
https://github.com/memoizr/rx-experiments
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/memoizr/rx-experiments
- Owner: memoizr
- License: apache-2.0
- Created: 2016-09-04T16:58:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-04T17:33:30.000Z (almost 9 years ago)
- Last Synced: 2025-02-12T07:55:32.658Z (5 months ago)
- Language: Kotlin
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxJava experiments
This is a boilerplate project to play with some aspects of RxJava.
There is a way to debug every single step of the RX chain and print it to console. Just put `.observeDebug()` immediately after each of your source observables, and subscribe with `.subscribeDebug()`.
Note that `.observeDebug()` is simply a marker that allows you to label the previous step as being the "origin".
Example:
```
Observable.just(1).observeDebug()
.observeOn(Schedulers.computation())
.map { it * 2 }
.observeOn(TestSchedulers.mainThread)
.subscribeDebug()
```Will print:
```
main | origin -> 1
RxComputationScheduler-3 | OperatorMap -> 2
main | > Subscribe block: 2
main | -> Subscribe block: |
```The format is:
```
{thread name} | {current execution block} > {value}
```