I have two external call which
I need to update each person status using second call from the sequence available in first call. This is how I tried,
getFuturePeople.map( (seqPeople : Seq[People]) => {
seqPeople.map(person => getStatus(person._id).status).map(status => {
//Update status for this person but I get Seq[Future[Peoson]]
})
})
Use can use Future.sequence
to transform the result, eg:
val futureOfSeq = Future.sequence(seqOfFuture)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With