Class: Bones::RPC::Protocol::Request

Inherits:
Object
  • Object
show all
Includes:
AdapterHelper
Defined in:
lib/bones/rpc/protocol/request.rb

Instance Method Summary collapse

Methods included from AdapterHelper

included, #receive_replies, #serialize

Constructor Details

#initialize(id, method, params) ⇒ Request

Returns a new instance of Request.



15
16
17
18
19
# File 'lib/bones/rpc/protocol/request.rb', line 15

def initialize(id, method, params)
  @id = id
  @method = method
  @params = params
end

Instance Method Details

#attach(node, future) ⇒ Object



38
39
40
# File 'lib/bones/rpc/protocol/request.rb', line 38

def attach(node, future)
  node.attach(:request, id, future)
end

#log_inspectObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/bones/rpc/protocol/request.rb', line 27

def log_inspect
  type = "REQUEST"
  fields = []
  fields << ["%-12s", type]
  fields << ["id=%s", id]
  fields << ["method=%s", method]
  fields << ["params=%s", params]
  f, v = fields.transpose
  f.join(" ") % v
end

#op_codeObject



23
24
25
# File 'lib/bones/rpc/protocol/request.rb', line 23

def op_code
  0
end