KotlinConf 2019: Asynchronous Data Streams with Kotlin Flow by Roman Elizarov

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 70

  • @vuluongtrieu2609
    @vuluongtrieu2609 5 лет назад +91

    3:00 buildList
    5:00 Channel
    9:55 flow
    13:40 flow vs list
    23:10 flow under the hood
    29:25 flow asynchronous yet sequential
    31:06 go concurrent with flow
    33:06 flow execution context
    36:36 flow in reactive ui
    42:27 roadmap

  • @mhdunknown
    @mhdunknown Год назад +1

    Being able to listen to smart people like Roman Elizarov explaining complex subjects in such simplicity is something we take for granted. I envy the people who work with him.

  • @manusarangal449
    @manusarangal449 10 месяцев назад +1

    Speaker was so articulate. Thank you so much for such an easy explanation of such complex topics.

  • @ale_lad
    @ale_lad 4 года назад +14

    What an awesome talk! Elizarov presentations are always very interesting

  • @AlexCouch65
    @AlexCouch65 4 года назад +47

    This talk really flowed well

  • @xandrviking1113
    @xandrviking1113 4 года назад +8

    Thank you Roman !!! Super workshop as always.

  • @donturner1928
    @donturner1928 2 года назад +1

    Big respect to the guy at 2:40 for sorting out Roman's mic 👍

  • @StrghtFrmHll
    @StrghtFrmHll 4 года назад +4

    'suspend' function is magic in its purest form.

  • @artemkhateev3650
    @artemkhateev3650 4 года назад +5

    Спасибо, Роман. Интересно)

  • @timkaborgalinov2848
    @timkaborgalinov2848 4 года назад +6

    Little observation -> Coroutines are becoming close to RXJava, because more and more operators are being released. They make the coroutines more complex and the main reason people moved from RX was the complexity, but despite this I can't help but notice that JetBrains does it in very beautiful way

    • @moldovanpeter5123
      @moldovanpeter5123 2 года назад +1

      You mean the Flow API, not the Coroutines :)

    • @mhdunknown
      @mhdunknown Год назад +1

      For one, it helps that Flow API's (or Kotlin in general) method names are succinct while having a clear meaning over what they do, that alone makes it triumphs RxJava.

  • @lional4898
    @lional4898 3 года назад +2

    Brain explosion. Such a neat elegant approach to further improve reactive programming

  • @chaze_chow_chow
    @chaze_chow_chow 4 года назад +1

    That`s definetly great videos, that can explain you all what you need to know about flow and how to start using them. Thank you!

  • @user-fg6ng7ej6w
    @user-fg6ng7ej6w 2 года назад +1

    very clear explanation when he uses marble diagrams

  • @dqle189
    @dqle189 Год назад +1

    such a wonderful talk, thank you for sharing all this knowledge in such an easy to understand way.

  • @kamillo0091
    @kamillo0091 4 года назад +5

    Great talk and Kotlin Flow seems an amazing feature!
    It's funny though, that Roman tells how RxJava is complicated because of all the operators (19:48), and at the end he's telling about bunch of new operators that will be added to Kotlin Flow :)

  • @michaelnajera7958
    @michaelnajera7958 5 лет назад +8

    Can't wait for that share operator

  • @zhou7yuan
    @zhou7yuan 4 года назад +3

    Recap On Kotlin Coroutines [0:46]
    Call back hell before
    Direct style with Kotlin Coroutines
    Asynchronous yet sequential
    (buildList) [2:58]
    Channel [4:57]
    Channel is hot🔥 [7:06]
    Kotlin Flow [9:41]
    Flow is cold❄️ [12:03]
    Flow is declarative [12:31]
    Flow vs List [13:38]
    Flow: Defined Declarative (Runs the flow -suspend)
    List: Runs Imperative (suspend)
    Execution order [15:14]
    Flow is reactive🚀 [16:16]
    RxJava / Project Reactor / Kotlin Flow -> Reactive Streams Specification
    Why Flow? (What's the difference? [17:53]
    (example of RxJava) [18:44]
    Flowable:
    map sync; flatMapSingle async
    filter sync; 🤯 async
    Flow [20:01]
    map(transform: suspend(T) -> R): Flow
    filter(predicate: suspend(T) -> Boolean): Flow
    Operator avoidance [20:53]
    onStart {} / onEach{} / catch {} / flow {}
    (Composable)
    Flow Under The Hood [23:04]
    (Backpressure) [26:08]
    Simple design => performance [26:31]
    Kotlin Flow Plays Scrabble (A Benchmark) [26:47]
    Time: Sequence < Flow < RxJava2
    Flow Is Asynchronous Yet Sequential [29:22]
    Going Concurrent With A Flow [31:06]
    flow.buffer().collect{}
    (internal use Channel) but (Declarative & safe)
    Flow Execution Context [33:06]
    (where to execute? always on collector) [34:22]
    .flowOn(Dispatchers.Default) [34:58]
    flow code executes in background, collector code still executes in its context
    (Context preservation) [36:13]
    Flow In Reactive UI [36:22]
    Managing Lifetime [38:26]
    (RxJava Subscription Example) [38:53]
    (Flow) [39:56]
    Status & RoadMap [42:12]
    Learn more [44:21]

  • @sztigirigi
    @sztigirigi 3 года назад +1

    I loved the talk. Gave thumbs up. But where is the thumbs down count Google??????

  • @alextheprophet7823
    @alextheprophet7823 5 лет назад +2

    Thanks for the talk. It cleared a lot of things for me.

  • @meseendev
    @meseendev 3 года назад

    Роман Елизаров , хорошо рассказывает

  • @vicboma1
    @vicboma1 5 лет назад +6

    Flow is cool, Awesome!

  • @web3tel
    @web3tel 4 года назад +1

    Would be interesting to see comparison of Kotlin Flow vs Scala ZIO

  • @xitize
    @xitize 4 года назад +3

    and again simple wins. 🚀

  • @mostasimbillah
    @mostasimbillah 4 года назад +2

    Thanks. Its a great talk.

  • @1995Shankar
    @1995Shankar 4 года назад +1

    nice explanation ....

  • @donwald3436
    @donwald3436 Год назад

    How would you cross Flow with Result? Let's say there's a function to access a paginated REST API. The function may loop over pages and emitAll their deserialized results. Then the REST API access does something unexpected like 400 Bad Request..... throw? return Result.failure? what else?

  • @eldathray9703
    @eldathray9703 4 года назад +2

    WOW. Amazing!
    I just want to know that where the slide can be downloaded, or when will it be released...?

    • @carlostomas4715
      @carlostomas4715 4 года назад

      All the Kotlin Talks can be found here: kotlinconf.com/talks/ and on each talk there is a link where you can download the slides. For this talk the link is this: resources.jetbrains.com/storage/products/kotlinconf2019/slides/Friday/A1/R.%20Elizarov,%202019%20KotlinConf%20-%20Kotlin%20Flows.pdf
      Happy coding! :)

    • @juliolemus2489
      @juliolemus2489 4 года назад

      I found it.
      resources.jetbrains.com/storage/products/kotlinconf2019/slides/Friday/A1/R.%20Elizarov,%202019%20KotlinConf%20-%20Kotlin%20Flows.pdf?_ga=2.135341745.100730859.1580057294-705069668.1580057294
      the rest of them:
      kotlinconf.com/talks/

  • @omarahmed9021
    @omarahmed9021 4 года назад +5

    That mouse cursor on slides 👀😒😅

  • @ben6
    @ben6 3 года назад +1

    flowOf, flowOn. Reminds me of Mister Miyagi, not that I actually watched the original film... 😅

  • @smreha
    @smreha 3 года назад

    Please make slides with dark background please.

  • @himattm
    @himattm 4 года назад

    Link to Flow Scrabble Benchmark
    github.com/Kotlin/kotlinx.coroutines/blob/develop/benchmarks/src/jmh/kotlin/benchmarks/flow/scrabble/README.md

  • @web3tel
    @web3tel 5 лет назад +1

    why hot/cold instead of eager/lazy?

    • @relizarov
      @relizarov 4 года назад +9

      Usually eager/lazy is used in a difference sense, especially in Kotiln. Lazy is something you compute on the first access and then save (cache) for future use. That's how both lazy { ... } and asyc(start=LAZY) { ... } works in Kotlin. Cold is different -- it is something you recompute on each access.

    • @web3tel
      @web3tel 4 года назад +1

      @@relizarov Thank you for clarification.

    • @viacheslavromanov3098
      @viacheslavromanov3098 4 года назад

      In c# it's called lazy execution. When the result is computed during the access a new item.

  • @ychvincent
    @ychvincent 4 года назад

    How about GlobalScope

  • @is0658
    @is0658 4 года назад

    when flow.buffer is going to be out

  • @alexneeky7920
    @alexneeky7920 5 лет назад

    just curious if there are going to tools for converting rxjava code to Kotlin flow

    • @krellin
      @krellin 4 года назад +3

      find replace

  • @bayraminanc885
    @bayraminanc885 4 года назад

    Wow, such an awesome content! Flow beat the shit out of RxJava.

  • @PavitraGolchha
    @PavitraGolchha 4 года назад

    Everything is nice except that cursor sitting on top left

  • @KiyoshiHiHiHi
    @KiyoshiHiHiHi 5 лет назад +4

    First of all, var and val are not acceptable in Japan.

  • @Charlie-zd2dr
    @Charlie-zd2dr 4 года назад

    Is he nervous?

  • @mykhailoyeromenko9167
    @mykhailoyeromenko9167 4 года назад +6

    Oh... we could implement rx fully in kotlin and try to optimize it for you, but we don’t care about you. Instead we will just implement ours own clone of rx with alien syntax so you will have something to learn on the weekend.

    • @ahmedmourad1683
      @ahmedmourad1683 4 года назад

      I actually like Flow's syntax more, also there are some changes (like context preservation for example) which are super useful that would be very hard to do if they were to just port Rx as they would be very misleading to developers users to Rx libraries.

    • @kevinsun123
      @kevinsun123 4 года назад +5

      Actually rx has more alienated syntax on kotlin

    • @protaties
      @protaties 4 года назад +2

      Wow, the one who wear leaves laugh at the inventing of clothes “implement their own clone of leaves with alien style”.

    • @mykhailoyeromenko9167
      @mykhailoyeromenko9167 4 года назад

      kdreamix Mak yeah... objects and functions which are well known and have the same names across multiple languages. What can be more alienated then that?)

  • @captspeedy1899
    @captspeedy1899 5 лет назад

    in a few years kotlin will be obsolete since java will have integrated new features:)

    • @cheesuscheetos4076
      @cheesuscheetos4076 5 лет назад +6

      Kotlin won't stagnate either, plus predicting the future is never easy realistically.
      All being said Kotlin would even in your scenario still continue to be a Google backed language for Android since Google and Java have parted ways.
      Also Kotlin native could become a thing and open a new set of possibilities.
      The thing with Kotlin is that thr language really keeps evolving and going forward.

    • @aNotoriousPhD
      @aNotoriousPhD 5 лет назад +7

      and do you think kotlin is just going to stay the same in the next few years? lmao no it's going to keep improving at the same rate. I don't think Java would be adding all of the new features that are planned if it weren't for Kotlin and Scala gaining so much popularity.

    • @yoshidis4
      @yoshidis4 5 лет назад +1

      Not everybody is an Oracle employee

    • @ahmedmourad1683
      @ahmedmourad1683 4 года назад +1

      Watch Jake Wharton's talk.

    • @PhilKulak
      @PhilKulak 4 года назад +1

      Oh yeah, Java is gonna get first class immutability, null safety and suspended threads REAL soon now.