class Grid::ZMQ::Stdin

Public Class Methods

new() click to toggle source
Calls superclass method Grid::ZMQ::Socket::new
# File lib/grid/zmq/stdin.rb, line 8
def initialize
  super(::ZMQ::SUB)

  send(:setsockopt, ::ZMQ::SUBSCRIBE, '')
end

Public Instance Methods

listen(address) { |parse| ... } click to toggle source
# File lib/grid/zmq/stdin.rb, line 14
def listen(address)
  send(:connect, address)

  loop do
    send(:recv_string, body = '')
    yield Command.parse(body)
  end
end