Package: io.vertx.groovy.core

## [Groovy] Class CompositeFuture

- io.vertx.groovy.core.CompositeFuture

- The composite future wraps a list of futures, it is useful when several futures needs to be coordinated.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CompositeFuture (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static CompositeFuture` | `all(Future<T1> f1, Future<T2> f2)` Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.
    `static CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like CompositeFuture.all but with 3 futures.
    `static CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like CompositeFuture.all but with 4 futures.
    `static CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like CompositeFuture.all but with 5 futures.
    `static CompositeFuture` | `all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like CompositeFuture.all but with 6 futures.
    `static CompositeFuture` | `all(java.util.List<Future> futures)` Like CompositeFuture.all but with a list of futures.
    `static CompositeFuture` | `any(Future<T1> f1, Future<T2> f2)` Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.
    `static CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like CompositeFuture.any but with 3 futures.
    `static CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like CompositeFuture.any but with 4 futures.
    `static CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like CompositeFuture.any but with 5 futures.
    `static CompositeFuture` | `any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like CompositeFuture.any but with 6 futures.
    `static CompositeFuture` | `any(java.util.List<Future> futures)` Like CompositeFuture.any but with a list of futures.
    `java.lang.Throwable` | `cause(int index)` Returns a cause of a wrapped future
    `void` | `complete(CompositeFuture result)` Set the result.
    `io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>>` | `completer()` @return an handler completing this future
    `Future<U>` | `compose(io.vertx.core.Handler<CompositeFuture> handler, Future<U> next)` Compose this future with a provided `next` future.
    `Future<U>` | `compose(java.util.function.Function<CompositeFuture, Future<U>> mapper)` Compose this future with a `mapper` function.
    `boolean` | `failed(int index)` Returns true if a wrapped future is failed
    `java.lang.Object` | `getDelegate()`
    `boolean` | `isComplete(int index)` Returns true if a wrapped future is completed
    `static CompositeFuture` | `join(Future<T1> f1, Future<T2> f2)` Return a composite future completed when all the futures are completed.
    `static CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3)` Like CompositeFuture.join but with 3 futures.
    `static CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)` Like CompositeFuture.join but with 4 futures.
    `static CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)` Like CompositeFuture.join but with 5 futures.
    `static CompositeFuture` | `join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)` Like CompositeFuture.join but with 6 futures.
    `static CompositeFuture` | `join(java.util.List<Future> futures)` Like CompositeFuture.join but with a list of futures.
    `Future<U>` | `map(java.util.function.Function<CompositeFuture, U> mapper)` Apply a `mapper` function on this future.
    `CompositeFuture` | `result()` The result of the operation.
    `T` | `resultAt(int index)` Returns the result of a wrapped future
    `CompositeFuture` | `setHandler(io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>> handler)`
    `int` | `size()` @return the number of wrapped future
    `boolean` | `succeeded(int index)` Returns true if a wrapped future is succeeded

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Future` | `cause, complete, complete, completer, compose, compose, fail, fail, failed, failedFuture, future, getDelegate, isComplete, map, map, result, setHandler, succeeded, succeededFuture, succeededFuture`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### CompositeFuture(java.lang.Object delegate)

  - ### Method Detail

    - #### static CompositeFuture all(Future<T1> f1, Future<T2> f2)

      Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

      The returned future fails as soon as one of `f1` or `f2` fails.
      Returns:
        the composite future
      Parameters:
        `f1` - future
        `f2` - future

    - #### static CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3)

      Like CompositeFuture.all but with 3 futures.

      Returns:
      Parameters:
        f1
        f2
        f3

    - #### static CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

      Like CompositeFuture.all but with 4 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4

    - #### static CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

      Like CompositeFuture.all but with 5 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5

    - #### static CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)

      Like CompositeFuture.all but with 6 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5
        f6

    - #### static CompositeFuture all(java.util.List<Future> futures)

      Like CompositeFuture.all but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Returns:
      Parameters:
        futures

    - #### static CompositeFuture any(Future<T1> f1, Future<T2> f2)

      Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.

      The returned future succeeds as soon as one of `f1` or `f2` succeeds.
      Returns:
        the composite future
      Parameters:
        `f1` - future
        `f2` - future

    - #### static CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3)

      Like CompositeFuture.any but with 3 futures.

      Returns:
      Parameters:
        f1
        f2
        f3

    - #### static CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

      Like CompositeFuture.any but with 4 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4

    - #### static CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

      Like CompositeFuture.any but with 5 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5

    - #### static CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)

      Like CompositeFuture.any but with 6 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5
        f6

    - #### static CompositeFuture any(java.util.List<Future> futures)

      Like CompositeFuture.any but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Returns:
      Parameters:
        futures

    - #### java.lang.Throwable cause(int index)

      Returns a cause of a wrapped future

      Returns:
      Parameters:
        `index` - the wrapped future index

    - #### void complete(CompositeFuture result)

      Set the result. Any handler will be called, if there is one, and the future will be marked as completed.

      Parameters:
        `result` - the result

    - #### io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>> completer()

      Returns:
        an handler completing this future

    - #### Future<U> compose(io.vertx.core.Handler<CompositeFuture> handler, Future<U> next)

      Compose this future with a provided `next` future.

      When this (the one on which `compose` is called) future succeeds, the `handler` will be called with the completed value, this handler should complete the next future.

      If the `handler` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the `next` future and the `handler` will not be called.

      Returns:
        the next future, used for chaining
      Parameters:
        `handler` - the handler
        `next` - the next future

    - #### Future<U> compose(java.util.function.Function<CompositeFuture, Future<U>> mapper)

      Compose this future with a `mapper` function.

      When this future (the one on which `compose` is called) succeeds, the `mapper` will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Returns:
        the composed future
      Parameters:
        `mapper` - the mapper function

    - #### boolean failed(int index)

      Returns true if a wrapped future is failed

      Returns:
      Parameters:
        `index` - the wrapped future index

    - #### java.lang.Object getDelegate()

    - #### boolean isComplete(int index)

      Returns true if a wrapped future is completed

      Returns:
      Parameters:
        `index` - the wrapped future index

    - #### static CompositeFuture join(Future<T1> f1, Future<T2> f2)

      Return a composite future completed when all the futures are completed.

      Succeeded when all futures are succeeded, failed when any future is failed.
      Returns:
        the composite future
      Parameters:
        `f1` - future
        `f2` - future

    - #### static CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3)

      Like CompositeFuture.join but with 3 futures.

      Returns:
      Parameters:
        f1
        f2
        f3

    - #### static CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

      Like CompositeFuture.join but with 4 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4

    - #### static CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

      Like CompositeFuture.join but with 5 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5

    - #### static CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)

      Like CompositeFuture.join but with 6 futures.

      Returns:
      Parameters:
        f1
        f2
        f3
        f4
        f5
        f6

    - #### static CompositeFuture join(java.util.List<Future> futures)

      Like CompositeFuture.join but with a list of futures.

      When the list is empty, the returned future will be already completed.

      Returns:
      Parameters:
        futures

    - #### Future<U> map(java.util.function.Function<CompositeFuture, U> mapper)

      Apply a `mapper` function on this future.

      When this future succeeds, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Returns:
        the mapped future
      Parameters:
        `mapper` - the mapper function

    - #### CompositeFuture result()

      The result of the operation. This will be null if the operation failed.

      Returns:
        the result or null if the operation failed.

    - #### T resultAt(int index)

      Returns the result of a wrapped future

      Returns:
      Parameters:
        `index` - the wrapped future index

    - #### CompositeFuture setHandler(io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>> handler)

    - #### int size()

      Returns:
        the number of wrapped future

    - #### boolean succeeded(int index)

      Returns true if a wrapped future is succeeded

      Returns:
      Parameters:
        `index` - the wrapped future index