Can any one help how can I send a request in parallel using coroutines for example I am sending a list of images to the server in parallel or sequentially
p
Paul Woitaschek
11/28/2019, 9:24 PM
images.map { async { send(it) } }.awaitAll()
Paul Woitaschek
11/28/2019, 9:25 PM
That's parallel; sequential would be just a
images.forEach { send(it) }
j
joeykaan
11/29/2019, 7:56 AM
There is one good thing to take into account though. If sending those does a data call you might have to change the actual thread those