No, right?
# coroutines
a
No, right?
m
It’s a way to run some code on the UI thread, although not the most idiomatic way
a
Ur right, but in our case it's already on main thread...
m
Then it will post it on the looper, so it’ll be added to the “queue” of the main thread, which is sometimes a desired behavior (rather than executing the code immediately). Still, it’s not very idiomatic, and usually it’s a hack.
👍 1
b
or you wan it to run concurrently
u
@bj0 concurrent to what?
b
to what comes after
launch
u
... which will run on the main thread as well. Even with coroutines you don't get concurrency on a single thread
b
concurrent isn't the same as parallel
u
So what kind of concurrency do you mean?
u
Thanks Brian. I am aware of the difference. I would just say that executing some blocking code and queueing another blocking piece of code to be executed after the first code finished does not really qualify as 'at once'. But that gets academic and possibly boreing for every body else. Thanks again for sharing the intention behind your comment.
b
ah I didn't see him say it was blocking, I just saw him ask why someone would use the snippet he posted