A gentle introduction to Kotlin Coroutines

A gentle introduction to Kotlin Coroutines

903d5bc2f50236c69d390ba4d5ff94a8?s=128

Arturo Mejia

March 25, 2019
Tweet

Transcript

  1. 2.
  2. 10.

    Reactive Extensions @ArturoMejia481 You have to change the way that

    you approach a problem. Operators RX Schedulers Streams
  3. 19.
  4. 20.

    Suspend @ArturoMejia481 The Kotlin compiler transforms the function to a

    callback model and uses state machines to know when a function should be suspended or resume.
  5. 25.

    Dispatchers @ArturoMejia481 DEFAULT (Computational) Uses the # cores of the

    CPU, not good for computations like I/O, network, disk, etc. IO designed for doing blocking I/O operations, max #64 thread, share the pool with DEFAULT. MAIN designed to operate UI objects. Indicate in which thread pool a coroutine should run
  6. 26.

    Interoperate @ArturoMejia481 kotlinx-coroutines-rx2: Utilities for Rx. kotlinx-coroutines-jdk8: Integration with JDK8

    CompletableFuture (Android API level 24). kotlinx-coroutines-android: Designed to operate UI objects.