Suspend Functions - Kotlin Coroutines

Suspend Functions - Kotlin Coroutines

Philipp Lackner

4 года назад

69,769 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@yashs1373
@yashs1373 - 27.04.2023 22:25

Great explanation

Ответить
@suntvhits
@suntvhits - 08.03.2023 08:27

Good explanation, But you didnot mention How can we run both functions in different time!!

Ответить
@khemmahato8420
@khemmahato8420 - 25.10.2022 06:13

does suspend function launches new coroutine or not please answer??

Ответить
@androidpc9656
@androidpc9656 - 18.10.2022 15:07

is the Suspend function used only to restrict a function to call inside a Coroutine scpoe or suspend function ? is there any other reason to use suspend function

Ответить
@Shasha-zs4dx
@Shasha-zs4dx - 05.08.2022 19:39

Clear and Precise with explanation..

Ответить
@swapnilkadam1391
@swapnilkadam1391 - 16.06.2022 16:00

commenting for YT algo

Ответить
@silvestreramirez4515
@silvestreramirez4515 - 05.12.2021 17:22

Should I switch Dispatcher y every network call or set dispatcher in the coroutine?

Ответить
@Kunal-jp8tn
@Kunal-jp8tn - 18.11.2021 20:50

Nice explanation. Thanks.

Ответить
@VenewebTV
@VenewebTV - 22.09.2021 17:35

Excellent Video, very useful, regards from Caracas, Venezuela :)

Ответить
@marinbeslo7841
@marinbeslo7841 - 16.09.2021 19:44

Just to mention, the networkCall() methods return the result after 3 seconds to their respective variables, but it needs 3+3=6 seconds to write them in the logcat.

Ответить
@brianmason3331
@brianmason3331 - 01.08.2021 18:12

Is there any roadmap we should take when watching your videos? I started with the Kotlin course then moved on to the android fundamentals course until I realized that I needed to learn some Jetpack Compose and started that until learning I needed to learn about coroutines and am now here.

Ответить
@tejas5331
@tejas5331 - 30.07.2021 21:10

I have been watching your videos from a week now and I have to say I have never understood things better than ever.

Ответить
@Sk-gb2hx
@Sk-gb2hx - 21.06.2021 12:01

+

Ответить
@moviesclips8539
@moviesclips8539 - 20.06.2021 12:14

great work...
very helpful and organised

Ответить
@amirsalarsalehi4968
@amirsalarsalehi4968 - 13.05.2021 18:12

cause you are logging message after call, it takes 6 second. if you logging result after each call, it would be 3 second. <3

Ответить
@haykmkrtchyan7093
@haykmkrtchyan7093 - 14.03.2021 17:20

Oh so that's the thing, when people say that suspend functions can be paused and resumed, actually they pause and resume the coroutine, in which scope they are running right?

Ответить
@bjugdbjk
@bjugdbjk - 04.03.2021 20:05

One key takeaway, code inside the launch is synchronous, Execution will wait until each line gets completed.

Ответить
@koutheirelbehi4384
@koutheirelbehi4384 - 25.02.2021 17:12

philipppppppp is born to be a teacher !!

Ответить
@SirDanMartin
@SirDanMartin - 21.02.2021 00:29

Nice clear and informative video, cheers.

Ответить
@daiyrkanybekov8575
@daiyrkanybekov8575 - 18.02.2021 09:23

Good tutorial Bro!

Ответить
@mehedihasansarik8427
@mehedihasansarik8427 - 10.01.2021 08:58

I would subscribe to your channel 10000000 times if there were any such option.

Ответить
@berkaytuzel1069
@berkaytuzel1069 - 21.12.2020 07:57

Hey got a quick question, if instead of assigning values to doNetworkCall and doNetworkCall2, we just said Log.d(TAG,doNetworkCall()) would it make a difference?

Ответить
@shamsularefin6491
@shamsularefin6491 - 17.12.2020 08:20

Amazing!!! just keep doint this type of amazing videos. Thanks for the videos.

Ответить
@karthikss6501
@karthikss6501 - 05.12.2020 09:08

Very clear explanation. Nice work. Thanks dude

Ответить
@adnanjr
@adnanjr - 30.10.2020 18:11

But you didn't explain what is a suspend function and why to use it.

Ответить
@rabiunislam9302
@rabiunislam9302 - 17.10.2020 21:08

Very easy and interactive way to teach coroutines. Keep it up.

Ответить
@ZaidZakir
@ZaidZakir - 28.09.2020 07:21

these videos are freaking excellent. i will recommend to all my android buddies. +1000000000 <3

Ответить
@crazyprogrammer3249
@crazyprogrammer3249 - 16.09.2020 08:26

Bro what's the difference when we call suspend or non-suspend function in coroutine?

Ответить
@Sree-ev6gp
@Sree-ev6gp - 23.08.2020 21:06

Awesome explanation.
I have a doubt regarding the adding up of delay times.
I tried following the same example, but in my case, it took 3 secs to print the first function response and after another 3 seconds, it printed the second function response unlike how it printed both the statements after 6 seconds. Is there a reason why it is happening like that?

GlobalScope.launch {
Log.d(TAG,doNetworkCall())
Log.d(TAG,doNetworkCall2())
}

suspend fun doNetworkCall():String {
delay(3000L)
return "this is a custom suspend function"
}

suspend fun doNetworkCall2():String {
delay(3000L)
return "this is a custom suspend function2"
}

Ответить
@hassanammer7854
@hassanammer7854 - 19.08.2020 07:14

Great work😍
If you can speak slowly to let us write notes behind you ❤️

Ответить
@nexgen.graphics
@nexgen.graphics - 15.08.2020 14:16

Finally I am starting to understand coroutines. You are doing a great job Sir.

Ответить
@VCodes
@VCodes - 01.08.2020 14:53

thank you so much. I will make sure to leave a like on every video i see. thats the least I could do.

Ответить
@mrpi230
@mrpi230 - 29.07.2020 20:14

Thank You good explanation.

Ответить
@haissayf
@haissayf - 22.07.2020 21:59

you got a new subscriber

Ответить
@JuanDanielOrnella
@JuanDanielOrnella - 01.07.2020 00:06

You are excelent!!

Ответить
@pavelb3734
@pavelb3734 - 16.06.2020 15:53

Very nice. Hope you will tell us about the influence of the delay on the delay in next videos)

Ответить
@roopaligoyal7916
@roopaligoyal7916 - 07.06.2020 13:36

Why is the delay added up? why is it not, that the first "This is the answer" statement printed after 3 second and the next after 3 more seconds?
Could you please help to clear my doubt.

Ответить
@RahulPawar-ok3nc
@RahulPawar-ok3nc - 30.05.2020 23:36

You deserve a lot more subscribers

Ответить
@hannanshaikh2616
@hannanshaikh2616 - 29.05.2020 19:50

delay and suspend functions are basically same, so how can we identify usage scenario means when to use delay and where suspend functions

Ответить
@NeitonSilva
@NeitonSilva - 17.05.2020 06:35

Simply the best!

Ответить
@cosovic14
@cosovic14 - 13.04.2020 23:20

Since you can actually run regular functions inside of a corountine, what is the actual purpose of a suspend function? What's the point?

Ответить
@AlgeriaHere
@AlgeriaHere - 03.04.2020 02:04

Helpful video thank you

Ответить
@MDDanishAnsariDev
@MDDanishAnsariDev - 02.04.2020 19:39

Nice 👌🏻

Ответить
@dawoodamir2011
@dawoodamir2011 - 02.04.2020 17:11

Thanks for this awsome content man.

Ответить
@play.againn
@play.againn - 02.04.2020 17:04

Best channel ever !

Ответить