Class: ASS::RPC::Future
- Inherits:
-
Object
- Object
- ASS::RPC::Future
- Defined in:
- lib/ass/rpc.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#header ⇒ Object
Returns the value of attribute header.
-
#message_id ⇒ Object
readonly
TODO set meta.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#method ⇒ Object
Returns the value of attribute method.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #done! ⇒ Object
- #done? ⇒ Boolean
-
#initialize(rpc, message_id) ⇒ Future
constructor
A new instance of Future.
- #inspect ⇒ Object
- #timeout? ⇒ Boolean
- #wait(timeout = nil, &block) ⇒ Object
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 = @rpc = rpc @timeout = false @done = false end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
25 26 27 |
# File 'lib/ass/rpc.rb', line 25 def data @data end |
#header ⇒ Object
Returns the value of attribute header.
25 26 27 |
# File 'lib/ass/rpc.rb', line 25 def header @header end |
#message_id ⇒ Object (readonly)
TODO set meta
24 25 26 |
# File 'lib/ass/rpc.rb', line 24 def @message_id end |
#meta ⇒ Object
Returns the value of attribute meta.
25 26 27 |
# File 'lib/ass/rpc.rb', line 25 def @meta end |
#method ⇒ Object
Returns the value of attribute method.
25 26 27 |
# File 'lib/ass/rpc.rb', line 25 def method @method end |
#timeout ⇒ Object
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
42 43 44 |
# File 'lib/ass/rpc.rb', line 42 def done? @done end |
#inspect ⇒ Object
50 51 52 |
# File 'lib/ass/rpc.rb', line 50 def inspect "#<#{self.class} #{}>" end |
#timeout? ⇒ 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 |