Class: Cql::Client::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/cql/client/synchronous_prepared_statement.rb

Instance Method Summary collapse

Constructor Details

#initialize(async_statement) ⇒ Pipeline

Returns a new instance of Pipeline.



31
32
33
34
# File 'lib/cql/client/synchronous_prepared_statement.rb', line 31

def initialize(async_statement)
  @async_statement = async_statement
  @futures = []
end

Instance Method Details

#execute(*args) ⇒ Object



36
37
38
# File 'lib/cql/client/synchronous_prepared_statement.rb', line 36

def execute(*args)
  @futures << @async_statement.execute(*args)
end

#valueObject



40
41
42
# File 'lib/cql/client/synchronous_prepared_statement.rb', line 40

def value
  Future.all(*@futures).value
end