Class: JsonRpc::Rpc::AsyncResult
- Inherits:
-
Object
- Object
- JsonRpc::Rpc::AsyncResult
- Includes:
- EventMachine::Deferrable
- Defined in:
- lib/json-rpc.rb
Overview
The class RpcDeferrable is useful helps you to build a Json Rpc server into an asynchronous way
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#each(&blk) ⇒ Object
FIXME thin specific.
- #reply(obj) ⇒ Object
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
114 115 116 |
# File 'lib/json-rpc.rb', line 114 def id @id end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
113 114 115 |
# File 'lib/json-rpc.rb', line 113 def response @response end |
Instance Method Details
#each(&blk) ⇒ Object
FIXME thin specific
121 122 123 |
# File 'lib/json-rpc.rb', line 121 def each &blk @callback = blk end |
#reply(obj) ⇒ Object
116 117 118 |
# File 'lib/json-rpc.rb', line 116 def reply obj @callback.call(Rpc::forge_response(obj, @id)) end |