Join Slack
Why do all methods in the docs for producing functions extend CoroutineScope? Is that just a convent...
# coroutines
d
df
11/22/2020, 6:55 PM
Why do all methods in the docs for producing functions extend CoroutineScope? Is that just a convention or does it serve a special purpose?
e
ephemient
11/22/2020, 7:10 PM
convention:
suspend fun
for functions that are logically "blocking" and wait for all work to complete before returning,
CoroutineScope
receiver or argument for functions which launch coroutines that continue running after the function's return
ephemient
11/22/2020, 7:11 PM
https://elizarov.medium.com/coroutine-context-and-scope-c8b255d59055
d
df
11/22/2020, 8:32 PM
thanks
5
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by