Class: Probject::Future

Inherits:
Object
  • Object
show all
Defined in:
lib/probject/future.rb

Instance Method Summary collapse

Constructor Details

#initialize(response_handler, id) ⇒ Future

Returns a new instance of Future.



3
4
5
6
# File 'lib/probject/future.rb', line 3

def initialize(response_handler, id)
  @response_handler = response_handler
  @id = id
end

Instance Method Details

#done?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/probject/future.rb', line 18

def done?
  @response_handler.done? @id
end

#getObject



8
9
10
# File 'lib/probject/future.rb', line 8

def get
  @response_handler.get @id
end

#get!Object



12
13
14
15
16
# File 'lib/probject/future.rb', line 12

def get!
  response = get
  raise response if response.kind_of? Exception
  response
end