Join Slack
Powered by
I met a strange problem with coroutines, when I pu...
# announcements
s
sailxjx
11/15/2017, 6:19 AM
I met a strange problem with coroutines, when I put async launch in loops, it will not execute for the same times as the iteration number.
Copy code
(1..100).forEach { n -> launch(CommonPool) { println(n) delay(100) } }
This code snippet will print random numbers, but always little than 100.
11
Views
Open in Slack
Previous
Next