Say I have a frame handler and it needs to authent...
# coroutines
l
Say I have a frame handler and it needs to authenticate which I have a suspending function for. Would it better to use the authenticate function from a launch or from a runblocking?
m
Well that depends on your handler. Does it work synchronously or asynchronously? The former would needs
runBlocking
the latter
launch
.
l
handler is async, can you please explain more why use launch if it is asynchronous?
o
runBlocking
will block until all coroutines started inside complete
m
launch
will run the coroutine and run it asynchronously.
handle
in the meantime will return from
launch
immediately,