class AgentZMQ::ReqAgent

Public Class Methods

new(name) click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 6
def initialize name
  @name=name
  @socket_opts=[]
end

Public Instance Methods

publish(msg) click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 24
 def publish msg
   AgentZMQ::Helpers.publish(zmq_socket, msg)
   AgentZMQ::Helpers.read_msg zmq_socket
end
reset() click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 29
def reset
  #no-op
end
sock_type() click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 11
def sock_type
  zmq_context.socket(ZMQ::REQ)
end
start() click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 15
def start
  zmq_socket
  sleep 0.8 # slow joiner
end
stop() click to toggle source
# File lib/agent_zmq/agents/req_agent.rb, line 20
def stop
  zmq_socket.close
end