Hey I want to call a PUT http request. I want to parallel asynchronous call multiple times with different id. So how can be possible to do in efficient way. Do i need to use flow ?
n
Nicolas Picon
10/16/2021, 5:25 AM
A flow is a sequence of values. Unless you want to retrieve the responses of each PUT, it doesn't match your use case. You should probably use something like
scope.async {}
for each request, and
awaitAll()
to wait on all resulting
Job
v
Vivek Modi
10/16/2021, 7:42 AM
@Nicolas Picon thanks for reply. I don't want to wait for any results i just want to send request.
n
Nicolas Picon
10/16/2021, 9:07 AM
Then you can use
scope.launch {}
but error management can be tricky if one of the request fails