Folks, quick help. Is this a right way? ```slackI...
# coroutines
m
Folks, quick help. Is this a right way?
Copy code
slackIncomingHook.sendText(SlackMessage("Attempting RTS for son's of length: ${stockOutwardNoteIds.size}, warehouseId: ${warehouse.id()}"))
stockOutwardNoteIds.map {
         async {
                           warehousing.packStockOutwardNote(warehouse.id(), it)
                           freshRTSHelper.markRTSForFreshOrder(warehouseId = warehouse.id(), stockOutwardNoteId = it)
                    }
         }.awaitAll()
m
So what are you trying to do?
m
take a bunch strings and want to do an action on them in parallel as they're all independent. Also,
freshRTSHelper.markRTSForFreshOrder
this is just an IO call.
m
Ok, and do you need the result of the call?
m
not really, but I want to know whether all of them got succeeded or not, that is why the next slack message
m
Ok, will it throw an exception if it fails or?
m
no it wont
it does send response as 500, 404 etc..,
m
Ok, so you need the response then. It seems good to me, as long as you have scoped your
async
correctly.