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

  Рет қаралды 77,945

JetBrains

JetBrains

Күн бұрын

Recording brought to you by American Express. americanexpress.io/kotlin-jobs
Kotlin Flow is a declarative mechanism for working with asynchronous data streams that builds on top of Kotlin coroutines and structured concurrency. Kotlin Flows are doing the same revolution in simplicity for data streams that suspending functions did for data values.
In this talk we will discuss the challenges of working with asynchronous streams and how Kotlin Flows solve them. We will study the basics of Kotlin Flow design, see their typical usage patterns, peek behind the scenes and into some of the implementation details, checkout flow performance and see how they enable writing safe, reliable, and leak-free systems. We will also discuss how they relate to and incorporate ideas from reactive extensions and reactive streams, how they are similar and different, and how they can be used together.
Resources:
KotlinConf website: jb.gg/fyaze5
KotlinConf on Twitter: / kotlinconf
Kotlin website: jb.gg/pxrsn6
Kotlin blog: jb.gg/7uc7ow
Kotlin on Twitter: / kotlin
#KotlinConf19 #Kotlin #JetBrains #KotlinFlows
About the Presenter:
Roman Elizarov works at JetBrains as Team Lead for Kotlin Libraries team, where he is focused on development and maintenance of multi-platform foundational libraries for Kotlin programming language. His main contribution in this role is design of Kotlin coroutines and development of Kotlin coroutines library.
In 2000 Roman Elizarov had graduated from St. Petersburg ITMO and started his career as a professional software developer. During his undergraduate study he participated in International Collegiate Programming Contests (ICPC). Since 1997 and until now Roman serves as a Chief Judge of Northern Eurasia Region of ICPC. He also maintains his academic ties and now teaches a course on concurrent and distributed programming at ITMO. Roman Elizarov had worked for most of his career at Devexperts, where he designed and developed high-performance trading software for leading brokerage firms and market data delivery services that routinely handle millions of events per second. He is an expert in Java and JVM, particularly in concurrency, real-time data processing, algorithms, and performance optimizations for modern architectures.

Пікірлер: 72
@LogicPhalanx
@LogicPhalanx 3 жыл бұрын
I'm a simple man, I see Roman Elizarov I click the Play button.
@vuluongtrieu2609
@vuluongtrieu2609 4 жыл бұрын
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
@MrDimakoles
@MrDimakoles 4 жыл бұрын
18:00 flow vs rxjava
@VicSorbi
@VicSorbi 4 жыл бұрын
And nice desktop at 1:09
@mhdunknown
@mhdunknown Жыл бұрын
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.
@ale_lad
@ale_lad 3 жыл бұрын
What an awesome talk! Elizarov presentations are always very interesting
@manusarangal449
@manusarangal449 5 ай бұрын
Speaker was so articulate. Thank you so much for such an easy explanation of such complex topics.
@AlexCouch65
@AlexCouch65 4 жыл бұрын
This talk really flowed well
@LogicPhalanx
@LogicPhalanx 3 жыл бұрын
I see what u did there.
@xandrviking1113
@xandrviking1113 4 жыл бұрын
Thank you Roman !!! Super workshop as always.
@artemkhateev3650
@artemkhateev3650 4 жыл бұрын
Спасибо, Роман. Интересно)
@chaze_chow_chow
@chaze_chow_chow 4 жыл бұрын
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!
@donturner1928
@donturner1928 Жыл бұрын
Big respect to the guy at 2:40 for sorting out Roman's mic 👍
@alextheprophet7823
@alextheprophet7823 4 жыл бұрын
Thanks for the talk. It cleared a lot of things for me.
@lional4898
@lional4898 3 жыл бұрын
Brain explosion. Such a neat elegant approach to further improve reactive programming
@dqle189
@dqle189 Жыл бұрын
such a wonderful talk, thank you for sharing all this knowledge in such an easy to understand way.
@timkaborgalinov2848
@timkaborgalinov2848 3 жыл бұрын
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 жыл бұрын
You mean the Flow API, not the Coroutines :)
@mhdunknown
@mhdunknown Жыл бұрын
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.
@StrghtFrmHll
@StrghtFrmHll 4 жыл бұрын
'suspend' function is magic in its purest form.
@user-fg6ng7ej6w
@user-fg6ng7ej6w 2 жыл бұрын
very clear explanation when he uses marble diagrams
@kamillo0091
@kamillo0091 4 жыл бұрын
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 4 жыл бұрын
Can't wait for that share operator
@vicboma1
@vicboma1 4 жыл бұрын
Flow is cool, Awesome!
@tomislavhoman4338
@tomislavhoman4338 3 жыл бұрын
It's cold :)
@mostasimbillah
@mostasimbillah 4 жыл бұрын
Thanks. Its a great talk.
@JetBrainsTV
@JetBrainsTV 4 жыл бұрын
Glad you enjoyed it
@1995Shankar
@1995Shankar 3 жыл бұрын
nice explanation ....
@xitize
@xitize 4 жыл бұрын
and again simple wins. 🚀
@web3tel
@web3tel 4 жыл бұрын
Would be interesting to see comparison of Kotlin Flow vs Scala ZIO
@meseendev
@meseendev 3 жыл бұрын
Роман Елизаров , хорошо рассказывает
@zhou7yuan
@zhou7yuan 4 жыл бұрын
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 2 жыл бұрын
I loved the talk. Gave thumbs up. But where is the thumbs down count Google??????
@eldathray9703
@eldathray9703 4 жыл бұрын
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/
@ychvincent
@ychvincent 4 жыл бұрын
How about GlobalScope
@is0658
@is0658 4 жыл бұрын
when flow.buffer is going to be out
@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?
@omarahmed9021
@omarahmed9021 4 жыл бұрын
That mouse cursor on slides 👀😒😅
@ben6
@ben6 3 жыл бұрын
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
@alexneeky7920
@alexneeky7920 4 жыл бұрын
just curious if there are going to tools for converting rxjava code to Kotlin flow
@krellin
@krellin 4 жыл бұрын
find replace
@web3tel
@web3tel 4 жыл бұрын
why hot/cold instead of eager/lazy?
@relizarov
@relizarov 4 жыл бұрын
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 жыл бұрын
@@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.
@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 4 жыл бұрын
First of all, var and val are not acceptable in Japan.
@GakisStylianos
@GakisStylianos 4 жыл бұрын
What?
@viacheslavromanov3098
@viacheslavromanov3098 4 жыл бұрын
Hahaha
@Charlie-zd2dr
@Charlie-zd2dr 4 жыл бұрын
Is he nervous?
@mykhailoyeromenko9167
@mykhailoyeromenko9167 4 жыл бұрын
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 жыл бұрын
Actually rx has more alienated syntax on kotlin
@protaties
@protaties 4 жыл бұрын
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 4 жыл бұрын
in a few years kotlin will be obsolete since java will have integrated new features:)
@cheesuscheetos4076
@cheesuscheetos4076 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
Not everybody is an Oracle employee
@ahmedmourad1683
@ahmedmourad1683 4 жыл бұрын
Watch Jake Wharton's talk.
@PhilKulak
@PhilKulak 4 жыл бұрын
Oh yeah, Java is gonna get first class immutability, null safety and suspended threads REAL soon now.
KotlinConf 2017 - Introduction to Coroutines by Roman Elizarov
45:32
Coroutines and Loom behind the scenes by Roman Elizarov
45:22
Kotlin by JetBrains
Рет қаралды 30 М.
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 35 МЛН
Alat Seru Penolong untuk Mimpi Indah Bayi!
00:31
Let's GLOW! Indonesian
Рет қаралды 16 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 54 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 5 МЛН
KotlinConf 2019: The Power of Types by Danny Preussler
34:49
JetBrains
Рет қаралды 22 М.
Роман Елизаров - Корутины в Kotlin
59:04
JPoint, Joker и JUG ru
Рет қаралды 62 М.
Untangling Coroutine Testing by Márton Braun
42:49
Kotlin by JetBrains
Рет қаралды 7 М.
The Essence of Coroutines
8:10
Dave Leeds
Рет қаралды 6 М.
Roman Elizarov - Structured concurrency
1:00:01
Hydra
Рет қаралды 24 М.
Samsung Galaxy 🔥 #shorts  #trending #youtubeshorts  #shortvideo ujjawal4u
0:10
Ujjawal4u. 120k Views . 4 hours ago
Рет қаралды 4,7 МЛН
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 44 МЛН
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 870 М.
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,2 МЛН