Elisabet Svensson Duranovic
11/21/2018, 12:22 PMmarstran
11/21/2018, 12:31 PMsuspend fun main() { ... }
is equivalent to fun main() = runBlocking { ... }
.Elisabet Svensson Duranovic
11/21/2018, 12:32 PMmarstran
11/21/2018, 12:33 PMElisabet Svensson Duranovic
11/21/2018, 12:42 PMmarstran
11/21/2018, 12:50 PMmain
. Like the `async`s in that example.runBlocking
would create that scope for you.Elisabet Svensson Duranovic
11/21/2018, 12:58 PMmarstran
11/21/2018, 1:00 PMcoroutineScope
to start coroutines like async
, launch
, produce
and so on. It's part of something called "structured concurrency". You can read more about it here: https://medium.com/@elizarov/structured-concurrency-722d765aa952Elisabet Svensson Duranovic
11/21/2018, 1:18 PMmarstran
11/21/2018, 1:30 PM