Class: RJR::Nodes::Template

Inherits:
RJR::Node show all
Defined in:
lib/rjr/nodes/template.rb

Constant Summary collapse

RJR_NODE_TYPE =
:tpl

Instance Attribute Summary

Attributes inherited from RJR::Node

#connection_event_handlers, #dispatcher, #message_headers, #node_id

Instance Method Summary collapse

Methods inherited from RJR::Node

#clear_event_handlers, em, #em, #halt, #indirect?, indirect?, #join, #node_type, #on, persistent?, #persistent?, tp, #tp

Constructor Details

#initialize(args = {}) ⇒ Template

Template Node Initializer



19
20
21
# File 'lib/rjr/nodes/template.rb', line 19

def initialize(args = {})
   super(args)
end

Instance Method Details

#invoke(optional_destination, rpc_method, *args) ⇒ Object

Instructs node to send rpc request, and wait for / return response.

Implementation of RJR::Node#invoke

Parameters:

  • optional_destination (String)

    if the transport requires it, param to specify the target of this request, if not remove this param

  • rpc_method (String)

    json-rpc method to invoke on destination

  • args (Array)

    array of arguments to convert to json and invoke remote method wtih



49
50
51
# File 'lib/rjr/nodes/template.rb', line 49

def invoke(optional_destination, rpc_method, *args)
  # TODO
end

#listenObject

Instruct Node to start listening for and dispatching rpc requests

Implementation of RJR::Node#listen



37
38
39
40
# File 'lib/rjr/nodes/template.rb', line 37

def listen
  # TODO
  self
end

#notify(optional_destination, rpc_method, *args) ⇒ Object

Instructs node to send rpc notification (immadiately returns / no response is generated)

Implementation of RJR::Node#notify

Parameters:

  • optional_destination (String)

    if the transport requires it, param to specify the target of this request, if not remove this param

  • rpc_method (String)

    json-rpc method to invoke on destination

  • args (Array)

    array of arguments to convert to json and invoke remote method wtih



60
61
62
# File 'lib/rjr/nodes/template.rb', line 60

def notify(optional_destination, rpc_method, *args)
  # TODO
end

#send_msg(data, connection) ⇒ Object

Send data using specified connection

Implementation of RJR::Node#send_msg



30
31
32
# File 'lib/rjr/nodes/template.rb', line 30

def send_msg(data, connection)
  # TODO
end

#to_sObject



23
24
25
# File 'lib/rjr/nodes/template.rb', line 23

def to_s
  "RJR::Nodes::Template<>"
end