Тёмный

KotlinConf 2018 - Exploring Coroutines in Kotlin by Venkat Subramaniam 

JetBrains
Подписаться 203 тыс.
Просмотров 96 тыс.
50% 1

Recording brought to you by American Express americanexpres...
Coroutines have intrigued programmers for a long time. Some languages of the past implemented coroutines, but programmers using the mainstream languages of recent decades largely did not get much exposure to this programming construct. There's a resurgence of interest for coroutines and some serious work has been done in Kotlin to implement it. We'll take an example oriented approach to learning about the benefits of coroutines and along the way explore this feature of Kotlin.
About the Presenter:
Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., creator of agilelearner.com, and an instructional professor at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences. Venkat helps his clients effectively apply and succeed with sustainable agile practices on their software projects. Venkat is a (co)author of multiple technical books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer. You can find a list of his books at agiledeveloper.com. You can reach him by email at venkats@agiledeveloper.com or on twitter at @venkat_s.

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 124   
@GooksanGom
@GooksanGom 3 года назад
Great, It really helped to understand coroutines. BTW, It's very impressive that he could keep talking without a break while he writes several lines of codes and runs it. There must have been coroutines running in his brain.
@canaldosouza4103
@canaldosouza4103 6 лет назад
This guy is who made me start kotlin, greet to see him in the Kotlin Conf
@navsingh7934
@navsingh7934 6 лет назад
same here man
@akashkroy
@akashkroy 3 года назад
I read his programming kotlin
@vasyan123
@vasyan123 6 лет назад
I'm a simple man. I see Venkat Subramariam in a video title, I click.
@chukzydee
@chukzydee 6 лет назад
Venkat and/or Florina on the title is enough to make me suspend all I'm doing and click on the video.
@salvatoreshiggerino6810
@salvatoreshiggerino6810 5 лет назад
To click is to do the needful
@j-r-hill
@j-r-hill 5 лет назад
It's so true
@AmarPoonia
@AmarPoonia 4 года назад
Same here.. even if I've watched it before, it's so satisfying
@gleb.ignatev
@gleb.ignatev 2 года назад
@@chukzydee suspend, you're saying, I see what you did here...
@VedantRajdeep
@VedantRajdeep 9 месяцев назад
That's some introduction. I like how he explained the "Why?" part of the changes.
@ChetanSachdeva
@ChetanSachdeva 6 лет назад
I've not seen anyone explaining the internals of coroutines better than Venkat Subramaniam.
@ViperCinema4D
@ViperCinema4D 6 лет назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YrrUCSi72E8.html
@navsingh7934
@navsingh7934 6 лет назад
he is the best speaker I have seen so far.
@aprofromuk
@aprofromuk 3 года назад
no 1 can do that :)
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 5 лет назад
This well co-ordinated explanation along with live coding demonstration is simply brilliant. He makes it look simple, but let me tell you, as some one who makes tutorials on RU-vid, this requires exceptional skills. Not just coding but presence of mind.
@yasserakbbach7342
@yasserakbbach7342 3 года назад
I refer to Venkat's lectures whenever I get to the mood of seeking out wisdom 😌
@benjaminrangel5313
@benjaminrangel5313 6 лет назад
I love Venkat voice, it is so calming.
@jimmyleo5414
@jimmyleo5414 4 года назад
What a god damn pro, sometimes I need to pause to think about what he said
@0xmg
@0xmg 4 года назад
The buffering does that for me
@thecoderui
@thecoderui 9 дней назад
​@@0xmg So lucky!
@norulesprateek
@norulesprateek 4 года назад
What a great explanation! You know he is an absolute professional when he shows how suspend functions are sending the rest of the code (Continuation) of the function as a parameter 28:24 . Everything including async block explanation was just great. He taught me things he wasn't even trying(possibly) to cover in this conf. Thanks!
@anshsachdeva850
@anshsachdeva850 3 года назад
This was so captivating. i didn't even felt for a minute that am staring at my screen for 44 minutes. amazing presentation. Anyone reading this comment in 2021 : How to access the launch{} function in coroutines 1.5?
@methodsignature
@methodsignature 5 лет назад
I've never seen anyone program in VI before. It felt a bit like black magic.
@aksh1618
@aksh1618 2 года назад
What a legend. Solved so many queries I had about coroutines with such simple but precise and amazing explanations.
@KaranSharmak4c6
@KaranSharmak4c6 2 года назад
Good examples. the multitasking while presentation using vim is incredible. !! Also the sound of claps at end of video says it all.
@DF-ss5ep
@DF-ss5ep 2 года назад
The one and only. We meet again.
@a0um
@a0um 5 лет назад
Great presentation. I really appreciated the use of bare bone editors and the love coding. I wish he slowed down a bit around the crucial points but understand it's a lot to cover in the given time. Impressive how he kept going confidently despite the inevitable typos, etc. I still have some questions about coroutines but this talk really gave me some good examples to think about.
@tak68tak
@tak68tak 4 года назад
He is really awesome. He is totally different from any other devs. It's like an entertainer or magician.
@leomak7580
@leomak7580 Год назад
the best speaker ever ) java versions are bumping, new langs come and go. but Venkat is a guy who always was with us )
@johnyrufus
@johnyrufus 2 года назад
That last example of step by step conversion from sequential -> suspend -> async did the trick for me :)
@dluxsoft2840
@dluxsoft2840 Год назад
thanks sir ,best lecture on coroutine
@rajushingadiya2860
@rajushingadiya2860 Год назад
Loved it
@antosha4e
@antosha4e 6 лет назад
really like a way he explains stuff, his talk about DSLs also nice
@thegreatestdao
@thegreatestdao 5 лет назад
This guys speech is so captivating!
@mehmoodrehman6336
@mehmoodrehman6336 2 года назад
Topics: 1. Parallel vs Asynchronous 0:50 (Java, Kotlin ahead of Java at least 5-years, Microservices, sequential vs parallel) coroutines make it easy to write asynchronous code. 2. Concurrency vs non-blocking 1:50 (Java example and comparison) 3. Let's examine parallel just a bit, in Java 2:30 (Java example and comparison) Parallel Stream: Structure of [functional] sequential code is the same as parallel code Coroutine: Structure of [Imperative] Synchronous code is the same as asynchronous code 4. Why not be happy with that? 5:20 5. Functional style is awesome 5:20 6. But, handling exceptions is a mess 5:44 7. Coroutines are asynchronous 6:25 launch { //launch () method } 8. From synchronous to asynchronous 9:00 Non-blocking GUI's 9. Blocking to non-blocking 10:12 10. How do coroutines work? 10:12 11. A sequential code 17:14 12. Using suspend 23:20, 24:30 Parallel Stream: Structure of [functional] sequential code is the same as parallel code Coroutine: Structure of [Imperative] Synchronous code is the same as asynchronous code 13. Doing asyn 33:00
@andromadusnaruto1544
@andromadusnaruto1544 Год назад
Awesome. Much appreciated...👍🏾
@hansmelo32
@hansmelo32 5 лет назад
Every the venkat's videos make me to want to be a better developer 💪🏿. Great explanation!
@aikqboy
@aikqboy 5 лет назад
He explains it so well and so simply. A very bright man.
@muhammadrahmatullahrahman1534
@muhammadrahmatullahrahman1534 4 года назад
Venkat is such an awesome teacher
@chrismakesgames9075
@chrismakesgames9075 3 года назад
This talk was great. Thanks Venkat!
@jesprotech
@jesprotech 2 года назад
Extraodinarly goed presentation! Explaining everything from how we got here, why apply coroutines and the way to do that in Kotlin with great examples. I especially loved that last example where we can see how small changes in the code can make it asynchronous using coroutines. The yield example was really a great step in getting there to explain that. It really helped me to make it even more clear to me what coroutines actualy are, what they can do and where to use them.
@igrai
@igrai 4 года назад
Frankly, found it quite convoluted
@terjemah_alquran
@terjemah_alquran 4 года назад
excellent excellent excellent
@AlexPaluzzi
@AlexPaluzzi 5 лет назад
One of the best talks I've watched in a long time.
@karthikrpandian
@karthikrpandian 5 лет назад
Amazing talk. Impressed by his coding and explanation going hand in hand.
@Nithr1s
@Nithr1s 5 лет назад
Just so you know, there is an error in explanation of "suspend" modifier. Explanation by Roman Elizarov could be found here: medium.com/@elizarov/blocking-threads-suspending-coroutines-d33e11bf4761
@harshvardhanjoshi7445
@harshvardhanjoshi7445 4 года назад
Great explanation. Must have been took months to find/create an example code which is this simple but very informative and covers almost everything. Great job.
@JetBrainsTV
@JetBrainsTV 4 года назад
Glad you liked it
@Wengelef
@Wengelef 5 лет назад
Venkat Superman
@JohnPywtorak
@JohnPywtorak 2 года назад
There are issues with this presentation, glossing over or missing key concepts. I would skip it if you are learning about coroutines. This was exploring, kinda, but really only the last 10 minutes are useful. The presenters book is decent, but this was not a good exploring talk. It appears I will be in the minority here. There are so few good coroutine talks, check out the Coroutines catch them all, best talk and maybe the only one.
@hassanalizadeh3492
@hassanalizadeh3492 3 года назад
Amazing presentation
@JetBrainsTV
@JetBrainsTV 3 года назад
Thank you! Cheers!
@pums12
@pums12 3 года назад
Just loved it. Thanks for this simple explanation
@МихаилСошников-в9р
Отличная информация, спасибо большое!
@thiagoalexandreee
@thiagoalexandreee 6 лет назад
Amazing talk, thanks for the content!
@smallufo
@smallufo 5 лет назад
Live coding! Awesome!
@JamielSheikh
@JamielSheikh 5 лет назад
Excellent stuff, Venkat. Great explanations and witty humor.
@bangoker
@bangoker 6 лет назад
Great talk! I like that it was very concise, but I could offer one piece of feedback is to have longer pauses /paragraph breaks. It feels a little bit like a giant paragraph would read. There are sentences, but it there is no place to rest, its just one big big paragraph.
@methodsignature
@methodsignature 5 лет назад
Yea, it felt a bit like catching a wave. If I didn't have much coroutine experience, I'm not sure I could have followed very well. Some of that was probably the time constraint of the setting.
@anmoldevgan7320
@anmoldevgan7320 5 лет назад
Venkat is God of programming
@andre-vm
@andre-vm 5 лет назад
3:10 HOLY MAMA! WATTA HELL IS GOIN' ON? (Nice talk, by the way. Good job!)
@hiteshchalise3988
@hiteshchalise3988 5 лет назад
this was fantastic.
@ashwin_mahajan
@ashwin_mahajan 3 года назад
Great great presentation. 🙌
@JetBrainsTV
@JetBrainsTV 3 года назад
Thank you kindly!
@sagarghare9829
@sagarghare9829 4 года назад
amazing and so engaging.
@NafiulIslam
@NafiulIslam 3 года назад
Great stuff!
@mohammedalzamil7191
@mohammedalzamil7191 4 года назад
yes
5 лет назад
"suspend modifier to a function makes it either asynchronous or non-blocking. " is not true according to the Roman Elizarov's article. medium.com/@elizarov/blocking-threads-suspending-coroutines-d33e11bf4761
@KiumarsAbedian
@KiumarsAbedian 4 года назад
Amazing talk, but I am curious what the setup is being used for interactive Kotlin/Java coding in vi/vim
@StasBar
@StasBar 5 лет назад
Great presentation, great teacher!
@vlastos
@vlastos 4 года назад
isnt this all wrong?slapping suspend on a blocking call doesnt not make it async, its just synchronous within dispatcher thread from launch
@animeshroy3746
@animeshroy3746 4 года назад
VERY GOOD EXPLANATION...
@VivekYadav-ds8oz
@VivekYadav-ds8oz 4 года назад
This guy literally looks like my maths professor.
@santanusur1265
@santanusur1265 5 лет назад
If getting Google's stock price took "2 seconds" and Amzn's stock price took 1 second... Then for the last example Amazon's stock price would show up earlier right ?
@ImaginaryNumb3r
@ImaginaryNumb3r 4 года назад
@37:53 So this all is really just syntactic sugar for Thread pools and ComplteableFutures?
@HermanBovens
@HermanBovens 6 лет назад
I think I get coroutines now, but I'm not really sure why in the last part of the video, everything still needs to be in a launch {} block. Doesn't the suspend / async / await mechanism already make it asynchronous?
@vyli1
@vyli1 6 лет назад
async {} can only be called from within a coroutine or a suspending function. In fact in the last example, the async call was not made from launch {} function, rather it was made from the lambda, that was passed as argument to the measure function. Since async {} can only be called from coroutine or a suspending function, he had to mark the lambda parameter from measure function as suspending. launch {} function is a coroutine builder. It hides lot of nontrivial code that you would have to write manually, if you wanted to write a coroutine.
@HermanBovens
@HermanBovens 6 лет назад
@@vyli1 so the call to launch() is indeed unnecessary?
@vyli1
@vyli1 6 лет назад
@@HermanBovens I'm sorry, I gave you a little bit misleading information. But first to answer your question, call to launch {} IS necessary. Originally I said, that async {} can only be called from coroutine or suspend function. This is not true, it can be called from wherever. However, .await() can only be called from coroutine or suspending function. Since in the code in the presentation we call .await() on result of async {} operation within lambda parameter, that lambda parameter MUST BE suspending lambda. (.await() can only be called from within a coroutine or suspending function). Since we've turned the lambda into a suspending function and we want to invoke the lambda from within measure function, we want to basically invoke a suspending function inside a nonsuspending function. That's not possible. Suspending functions can only be invoked from other suspending functions, or coroutines. Therefore, the measure function itself must be suspending. As I said before, suspend functions can only be called from within coroutines or another suspending functions. And we want to call the measure function. But measure function is suspending. Therefore we need to create a coroutine, from which we can call the measure function. That's why we do the call to launch {}. launch {} is a coroutine builder. It will build all the coroutine boilerplate code for us. So when we invoke our suspending function measure from within launch, our code will be executed within a coroutine, so the compiler will finally let us compile this code. There are other coroutine builders than launch, for example runBlocking {}, but in this case we didn't want to block the main thread, so that's why launch {} coroutine builder was chosen. When I said .await() can only be called from coroutine or another suspending function, what I mean is, compiler won't let you compile a code, where you'd want to invoke suspending function outside of a coroutine or a suspending function.
@antoniokomangyudistira4150
@antoniokomangyudistira4150 4 года назад
the " A sequential code" part is hard to understand :(
@studyonline3236
@studyonline3236 3 года назад
How is he auto-filling sentences ?
@conorsmall1373
@conorsmall1373 Год назад
what a killer mustache
@abubakrjabbarov2303
@abubakrjabbarov2303 5 лет назад
A very good explanation, thank you!
@siva_subramaniam
@siva_subramaniam Год назад
Bm -16:58
@AjithKumar-vk1fw
@AjithKumar-vk1fw 3 года назад
👍
@_dinesh
@_dinesh 2 года назад
TBH, Very hard to follow. Keep the sentences simple and the example simpler.
@Saketjsaket
@Saketjsaket 4 года назад
Which IDE is he using to show the demo?
@syedtayyabulmazhar6945
@syedtayyabulmazhar6945 3 года назад
He is coding and explaining at the same time. He is so async.
@jayasome199
@jayasome199 2 года назад
27:00 Only moment, I can laugh.
@jayasome199
@jayasome199 2 года назад
28:30 suspend bytecode -> Continuation
@archiequinones6467
@archiequinones6467 5 лет назад
Wow that was really good!! 😱😱 👏👏 just really wanna show my appreciation here 👏👏
@maxchin2
@maxchin2 5 лет назад
He need pauses.
@rafihmahfooz5074
@rafihmahfooz5074 5 лет назад
He changed camps, first Scala, now this lol
@jobiraw
@jobiraw 5 лет назад
is this man from pragimtech.com ?
@JetBrainsTV
@JetBrainsTV 5 лет назад
No, we don't believe so. Dr. Venkat Subramaniam is the founder of Agile Developer, Inc. agiledeveloper.com
@jakubgwozdz2780
@jakubgwozdz2780 6 лет назад
What is that, well, IDE?
@meribold
@meribold 6 лет назад
That's a text editor. Probably TextMate.
@jakubgwozdz2780
@jakubgwozdz2780 6 лет назад
I like the way it displays output at cursor.
@akashpatra19
@akashpatra19 5 лет назад
@@jakubgwozdz2780 Yes, you have to configure. Long back after I saw his talk on Java Streams, I also configured like that. :)
@igorg.8624
@igorg.8624 6 лет назад
What do Coroutines offer that RxJava does not?
@RobertGolusinski
@RobertGolusinski 6 лет назад
proandroiddev.com/kotlin-coroutines-vs-rxjava-an-initial-performance-test-68160cfc6723
@robchr
@robchr 6 лет назад
It doesn't offer anything that RxJava cannot do. Coroutines can easily represent RxJava's Single and Maybe contexts but does not handle Observable streams without additional boilerplate. For some use cases where there would be a large number of concurrent requests like a server that has 100k+ concurrent connections, coroutines could be more memory efficient since it requrires less intermediate objects (lambdas). Coroutines represent a single chain in a single object that acts like a state machine.
@igorg.8624
@igorg.8624 6 лет назад
... although I must say - sequence continuations in Coroutines are super simple to reason about and much easier to teach to a newbie than RxJava
@GK-rl5du
@GK-rl5du 6 лет назад
It doesn't offer anything new as compared with RxJava or even any callback+eventloop models. The main promise of coroutines is that one can write syncrhonous looking code which the runtime executes concurrently. On the other hand, consider Rx... one has to be familiar with the core Rx interfaces like Observable... although this approach was much better than callback hell.. esp considering exception handling.. there's still a learning curve. Coroutines on the other hand will bring concurrency to where you are.
@vlastos
@vlastos 4 года назад
I love rx, but flatmapping singles is stupid and you need to always return tuples everywhere like an idiot
@harshtiwari9588
@harshtiwari9588 5 лет назад
Which editor does he use?
@akashpatra19
@akashpatra19 5 лет назад
TextMate.
@sundeepsharma6782
@sundeepsharma6782 2 года назад
Sir, with due respect u have very nice knowledge but ur are speaking very fast, and hard to catch you and i lost my interest.
@pradeepkumarreddykondreddy7048
this guy is too fast
@RameshK-dy6yb
@RameshK-dy6yb 4 года назад
for simple basics ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-x2QOzdh0Fqs.html
@nO_d3N1AL
@nO_d3N1AL 5 лет назад
Not his best talk. Surprised and disappointed that he didn't compare coroutines to using threads directly and Futures. He didn't really say what co-routines add that we can't do since Java 5
@aaaab384
@aaaab384 5 лет назад
If you have such a thick accent, consider SLOWING DOWN A LOT.
@einfacherkerl3279
@einfacherkerl3279 5 лет назад
his talking style is very...... weird
6 лет назад
Instead of suspend measureTime you could have made it inline, i think it would work with await 😀 really nice talk btw, finally understood coroutines
@hhhapz
@hhhapz 6 лет назад
I think the goal of the talk was to show how suspend functions make a difference, and allow thread blocking versus non-suspension functions.
@pinoy_marites_beh
@pinoy_marites_beh Год назад
I finally know what to do when someone asks me to put the status bar below the phone and the system back actions on top of the screen! Run for the exit!!!!!
@edjinretrogamer
@edjinretrogamer 3 года назад
Meu Deus, pare 1 segundo pra respirar!!!
@VivekMore1
@VivekMore1 5 лет назад
You have the last name of Venkat spelled wrong in the title
@JetBrainsTV
@JetBrainsTV 5 лет назад
Thank you. Fixed.
@rIyAsE
@rIyAsE 3 года назад
One of the best talk on coroutines (Y)
Далее
KotlinConf 2018 - Android Suspenders by Chris Banes
38:29
Ozoda & Dilime - Lada
00:36
Просмотров 1,4 млн
Kotlin for Java Programmers by Venkat Subramaniam
51:40
Channels in Kotlin Coroutines | Nikita Koval
45:20
Просмотров 7 тыс.
Italian Restaurant - SNL
4:26
Просмотров 12 млн
Ozoda & Dilime - Lada
00:36
Просмотров 1,4 млн