Class: ASS::RPC::Future

Inherits:
Object
  • Object
show all
Defined in:
lib/ass/rpc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rpc, message_id) ⇒ Future

Returns a new instance of Future.



27
28
29
30
31
32
# File 'lib/ass/rpc.rb', line 27

def initialize(rpc,message_id)
  @message_id = message_id
  @rpc = rpc
  @timeout = false
  @done = false
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



25
26
27
# File 'lib/ass/rpc.rb', line 25

def data
  @data
end

#headerObject

Returns the value of attribute header.



25
26
27
# File 'lib/ass/rpc.rb', line 25

def header
  @header
end

#message_idObject (readonly)

TODO set meta



24
25
26
# File 'lib/ass/rpc.rb', line 24

def message_id
  @message_id
end

#metaObject

Returns the value of attribute meta.



25
26
27
# File 'lib/ass/rpc.rb', line 25

def meta
  @meta
end

#methodObject

Returns the value of attribute method.



25
26
27
# File 'lib/ass/rpc.rb', line 25

def method
  @method
end

#timeoutObject

Returns the value of attribute timeout.



26
27
28
# File 'lib/ass/rpc.rb', line 26

def timeout
  @timeout
end

Instance Method Details

#done!Object



38
39
40
# File 'lib/ass/rpc.rb', line 38

def done!
  @done = true
end

#done?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/ass/rpc.rb', line 42

def done?
  @done
end

#inspectObject



50
51
52
# File 'lib/ass/rpc.rb', line 50

def inspect
  "#<#{self.class} #{message_id}>"
end

#timeout?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/ass/rpc.rb', line 46

def timeout?
  @timeout
end

#wait(timeout = nil, &block) ⇒ Object



34
35
36
# File 'lib/ass/rpc.rb', line 34

def wait(timeout=nil,&block)
  @rpc.wait(self,timeout,&block) # synchronous call that will block
end