mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Implement batchAndParallelExecute with Future.traverse rather than Future.sequence (#5051)
This commit is contained in:
parent
5f9c89820f
commit
3740b4fc35
@ -122,9 +122,8 @@ object FutureUtil {
|
||||
Future.successful(Vector.empty)
|
||||
} else {
|
||||
val batches = elements.grouped(batchSize).toVector
|
||||
val execute: Vector[Future[U]] = batches.map(b => f(b))
|
||||
val doneF = Future.sequence(execute)
|
||||
doneF
|
||||
val executeF: Future[Vector[U]] = Future.traverse(batches)(f(_))
|
||||
executeF
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user