Method: Manticore::Client#execute!

Defined in:
lib/manticore/client.rb

#execute!Array

Execute all queued async requests

Returns:

  • (Array)

    An array of the responses from the requests executed.



354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/manticore/client.rb', line 354

def execute!
  method = executor.java_method(:submit, [java.util.concurrent.Callable.java_class])

  result = []
  result << method.call(@async_requests.pop) until @async_requests.empty?
  result.map do |future|
    begin
      future.get
    rescue Java::JavaUtilConcurrent::ExecutionException => e
      # These exceptions should be handled in on_failure blocks.
    end
  end
end