module Parser
Public Class Methods
activate(topic, endpoint)
click to toggle source
# File lib/harvester/parser.rb, line 8 def self.activate topic, endpoint puts topic, endpoint listener = EZMQ::Subscriber.new :connect, port: 5050, topic: topic, decode: -> m { Oj.load m } listener.listen do |message, topic| data = plow message, topic data.each do |item| puts @broadcaster.send item, topic: topic end end end
plow(message, parse)
click to toggle source
# File lib/harvester/parser.rb, line 19 def self.plow message, parse require_relative "../../parser_functions/#{parse}" send(parse, message) end