Class: JsonRpc::Rpc::AsyncResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



114
115
116
# File 'lib/json-rpc.rb', line 114

def id
  @id
end

#responseObject (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