Class: Elementary::Future

Inherits:
Concurrent::Future
  • Object
show all
Defined in:
lib/elementary/future.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *params) ⇒ Object

Invoke undefined methods on the value of the future

E.g.

results = c.rpc.search(query)
# sleep maxint
results.each do |result|
  # work
end

Which would really invoke:

results.value.each


17
18
19
# File 'lib/elementary/future.rb', line 17

def method_missing(method, *params)
  self.value.send(method, *params)
end