RxJava - Getting Started

F31c7fbcbb0766d0632d96fd7e74b649?s=47 Brice Dutheil
September 09, 2014

RxJava - Getting Started

Nowadays applications are getting increasingly interconnected. Web Oriented Architecture or Micro-Service Architecture for example show there's a growing trend that integrating multiple different web services at different scale.

How to compose or aggregate all of these interactions in a usable result ; but especially how to implement it in a meaningful and readable code, with loose coupling and without temporal coupling ?

RxJava offers an elegant way to write synchronous and asynchronous code with enhanced composition capabilities. In this lightning talk we will present basic concepts of Rx (Reactive eXtensions).

David Wursteisen - Brice Dutheil / Human Talks Paris / September 9th 2014
Video of this presentation is on parleys in French :
https://www.parleys.com/tutorial/rxjava-getting-started-1

F31c7fbcbb0766d0632d96fd7e74b649?s=128

Brice Dutheil

September 09, 2014
Tweet

Transcript

  1. 12.
  2. 13.
  3. 14.
  4. 15.
  5. 16.
  6. 22.

    Observable Observable.from(1, 2, 3, 4) Observable.from(asyncTask.getFuture()) Observable.range(1, 4400) Observable.timer(0, 5,

    TimeUnit.SECONDS) Observable.create(...) Observable.from(anIterable) Observable.just(73) Observable.error(new Exception()) Observable.empty() ...
  7. 42.
  8. 43.
  9. 44.

    Opérateurs Observable.from(1, 2, 3, 4) .filter((i) -> (i % 2)

    == 0) .subscribe(System.out::println) 2
  10. 45.

    Opérateurs Observable.from(1, 2, 3, 4) .filter((i) -> (i % 2)

    == 0) .subscribe(System.out::println) 2 4
  11. 49.

    Opérateurs Observable.from(1, 2, 3, 4) .map((i) -> i * 10)

    .subscribe(System.out::println); 10 20 30 40