Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Topics in Concurrency and Reactive Programming

Similar presentations


Presentation on theme: "Advanced Topics in Concurrency and Reactive Programming"— Presentation transcript:

1 Advanced Topics in Concurrency and Reactive Programming
Majeed Kassis

2 The Marble Diagram This style of diagram is useful to illustrate the behavior we wish to achieve using ReactiveX. See

3 Map Operation

4 Map Example

5 Filter Operation

6 Filter Example

7 Merge Operation

8 Merge Example 1 2 3 4 5 6 7 8 9 private void mergeExample() {
final String[] aStrings = {"A1", "A2", "A3", "A4"}; final String[] bStrings = {"B1", "B2", "B3"}; final Observable<String> aObservable = Observable.fromArray(aStrings); final Observable<String> bObservable = Observable.fromArray(bStrings); Observable.merge(aObservable, bObservable) .subscribe(getObserver()); }

9 Combining via Zip

10 Error Handling: onErrorResumeNext
The onErrorResumeNext method returns an Observable that mirrors the behavior of the source Observable, unless that Observable invokes onError in which case, rather than propagating that error to the observer, onErrorResumeNext will instead begin mirroring a second, backup Observable.

11 Error Handling: onErrorReturn

12 OnErrorReturn (something) Example

13

14

15

16

17

18

19

20

21


Download ppt "Advanced Topics in Concurrency and Reactive Programming"

Similar presentations


Ads by Google