The join composition waits until all futures are completed, either with a success or a failure.
CompositeFuture.join
takes several futures arguments (up to 6) and returns a future that is succeeded when all the futures are succeeded, and failed when all the futures are completed and at least one of them is failed:
While the all composition waits until all futures are successful (or one fails), the any composition waits for the first succeeded future.
CompositeFuture.any
takes several futures arguments (up to 6) and returns a future that is succeeded when one of the futures is, and failed when all the futures are failed:
Version
4.0.3 ~ 4.3.3
Context
I created a reproducer as follows.
5 tasks are executed concurrently, and some tasks will fail randomly and at least one task succeeds.
As expected:
CompositeFuture.all will wait all tasks completed and return a future that is failed.
CompositeFuture.any will return when one task complete and return a future that is failed.
CompositeFuture.join will wait all tasks completed and return a future that is succeeded.
But the program runs not as expected, as CompositeFuture.any actually runs as CompositeFuture.join and CompositeFuture.join actually runs as CompositeFuture.any.
Questions
as described in vertx.io
CompositeFuture.join takes several futures arguments (up to 6) and returns a future that is succeeded when all the futures are succeeded, and failed when all the futures are completed and at least one of them is failed:
CompositeFuture.any takes several futures arguments (up to 6) and returns a future that is succeeded when one of the futures is, and failed when all the futures are failed:
Version
4.0.3 ~ 4.3.3
Context
I created a reproducer as follows.
5 tasks are executed concurrently, and some tasks will fail randomly and at least one task succeeds. As expected:
But the program runs not as expected, as CompositeFuture.any actually runs as CompositeFuture.join and CompositeFuture.join actually runs as CompositeFuture.any.
Do you have a reproducer?
Steps to reproduce