Class List Method List File List

# Class: Vertx::CompositeFuture

Inherits:
  Future
  - Object
  - Future
  - Vertx::CompositeFuture
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb

## Overview

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

## Class Method Summary (collapse)

- + (::Vertx::CompositeFuture) all(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
  Like #all but with 6 futures.
- + (::Vertx::CompositeFuture) any(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
  Like #any but with 6 futures.

## Instance Method Summary (collapse)

- - (Exception) cause(index = nil)
  Returns a cause of a wrapped future.
- - (true, false) complete?(index = nil)
  Returns true if a wrapped future is completed.
- - (true, false) failed?(index = nil)
  Returns true if a wrapped future is failed.
- - (Object) result(index = nil)
  Returns the result of a wrapped future.
- - (self) set_handler { ... }
- - (Fixnum) size
  @return the number of wrapped future.
- - (true, false) succeeded?(index = nil)
  Returns true if a wrapped future is succeeded.

### Methods inherited from Future

#complete, #completer, #compose, #fail, failed_future, future, #map, succeeded_future

## Class Method Details

### + (`::Vertx::CompositeFuture`) all(futures) + (`::Vertx::CompositeFuture`) all(f1, f2) + (`::Vertx::CompositeFuture`) all(f1, f2, f3) + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4) + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4, f5) + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4, f5, f6)

Like #all but with 6 futures.

Overloads:

- + (`::Vertx::CompositeFuture`) all(futures)

  Parameters:

  - futures (`Array<::Vertx::Future>`)
- + (`::Vertx::CompositeFuture`) all(f1, f2)

  Parameters:

  - f1 (`::Vertx::Future`) —
    future
  - f2 (`::Vertx::Future`) —
    future
- + (`::Vertx::CompositeFuture`) all(f1, f2, f3)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4, f5)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
  - f5 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) all(f1, f2, f3, f4, f5, f6)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
  - f5 (`::Vertx::Future`)
  - f6 (`::Vertx::Future`)

Returns:

- (`::Vertx::CompositeFuture`)

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 48

    def self.all(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
      if param_1.class == Array && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::JavaUtil::List.java_class]).call(param_1.map { |element| element.j_del }),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && !block_given? && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && !block_given? && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && !block_given? && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && param_5.class.method_defined?(:j_del) && !block_given? && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del,param_5.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && param_5.class.method_defined?(:j_del) && param_6.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:all, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del,param_5.j_del,param_6.j_del),::Vertx::CompositeFuture)
      end
      raise ArgumentError, "Invalid arguments when calling all(param_1,param_2,param_3,param_4,param_5,param_6)"
    end

### + (`::Vertx::CompositeFuture`) any(futures) + (`::Vertx::CompositeFuture`) any(f1, f2) + (`::Vertx::CompositeFuture`) any(f1, f2, f3) + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4) + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4, f5) + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4, f5, f6)

Like #any but with 6 futures.

Overloads:

- + (`::Vertx::CompositeFuture`) any(futures)

  Parameters:

  - futures (`Array<::Vertx::Future>`)
- + (`::Vertx::CompositeFuture`) any(f1, f2)

  Parameters:

  - f1 (`::Vertx::Future`) —
    future
  - f2 (`::Vertx::Future`) —
    future
- + (`::Vertx::CompositeFuture`) any(f1, f2, f3)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4, f5)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
  - f5 (`::Vertx::Future`)
- + (`::Vertx::CompositeFuture`) any(f1, f2, f3, f4, f5, f6)

  Parameters:

  - f1 (`::Vertx::Future`)
  - f2 (`::Vertx::Future`)
  - f3 (`::Vertx::Future`)
  - f4 (`::Vertx::Future`)
  - f5 (`::Vertx::Future`)
  - f6 (`::Vertx::Future`)

Returns:

- (`::Vertx::CompositeFuture`)

Raises:

- (`ArgumentError`)

    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 93

    def self.any(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
      if param_1.class == Array && !block_given? && param_2 == nil && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::JavaUtil::List.java_class]).call(param_1.map { |element| element.j_del }),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && !block_given? && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && !block_given? && param_4 == nil && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && !block_given? && param_5 == nil && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && param_5.class.method_defined?(:j_del) && !block_given? && param_6 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del,param_5.j_del),::Vertx::CompositeFuture)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class.method_defined?(:j_del) && param_4.class.method_defined?(:j_del) && param_5.class.method_defined?(:j_del) && param_6.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::CompositeFuture.java_method(:any, [Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class,Java::IoVertxCore::Future.java_class]).call(param_1.j_del,param_2.j_del,param_3.j_del,param_4.j_del,param_5.j_del,param_6.j_del),::Vertx::CompositeFuture)
      end
      raise ArgumentError, "Invalid arguments when calling any(param_1,param_2,param_3,param_4,param_5,param_6)"
    end

## Instance Method Details

### - (`Exception`) cause(index = nil)

Returns a cause of a wrapped future

Parameters:

- index (`Fixnum`) (defaults to: `nil`) —
  the wrapped future index

Returns:

- (`Exception`)

Raises:

- (`ArgumentError`)

    121
    122
    123
    124
    125
    126
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 121

    def cause(index=nil)
      if index.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.from_throwable(@j_del.java_method(:cause, [Java::int.java_class]).call(index))
      end
      raise ArgumentError, "Invalid arguments when calling cause(index)"
    end

### - (`true`, `false`) complete?(index = nil)

Returns true if a wrapped future is completed

Parameters:

- index (`Fixnum`) (defaults to: `nil`) —
  the wrapped future index

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    148
    149
    150
    151
    152
    153
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 148

    def complete?(index=nil)
      if index.class == Fixnum && !block_given?
        return @j_del.java_method(:isComplete, [Java::int.java_class]).call(index)
      end
      raise ArgumentError, "Invalid arguments when calling complete?(index)"
    end

### - (`true`, `false`) failed?(index = nil)

Returns true if a wrapped future is failed

Parameters:

- index (`Fixnum`) (defaults to: `nil`) —
  the wrapped future index

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    139
    140
    141
    142
    143
    144
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 139

    def failed?(index=nil)
      if index.class == Fixnum && !block_given?
        return @j_del.java_method(:failed, [Java::int.java_class]).call(index)
      end
      raise ArgumentError, "Invalid arguments when calling failed?(index)"
    end

### - (`Object`) result(index = nil)

Returns the result of a wrapped future

Parameters:

- index (`Fixnum`) (defaults to: `nil`) —
  the wrapped future index

Returns:

- (`Object`)

Raises:

- (`ArgumentError`)

    157
    158
    159
    160
    161
    162
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 157

    def result(index=nil)
      if index.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:result, [Java::int.java_class]).call(index))
      end
      raise ArgumentError, "Invalid arguments when calling result(index)"
    end

### - (`self`) set_handler { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    111
    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 111

    def set_handler
      if block_given?
        @j_del.java_method(:setHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::CompositeFuture) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_handler()"
    end

### - (`Fixnum`) size

@return the number of wrapped future

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    165
    166
    167
    168
    169
    170
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 165

    def size
      if !block_given?
        return @j_del.java_method(:size, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling size()"
    end

### - (`true`, `false`) succeeded?(index = nil)

Returns true if a wrapped future is succeeded

Parameters:

- index (`Fixnum`) (defaults to: `nil`) —
  the wrapped future index

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    130
    131
    132
    133
    134
    135
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/composite_future.rb', line 130

    def succeeded?(index=nil)
      if index.class == Fixnum && !block_given?
        return @j_del.java_method(:succeeded, [Java::int.java_class]).call(index)
      end
      raise ArgumentError, "Invalid arguments when calling succeeded?(index)"
    end