Files
analyzer-pipeline/lib/pipeline/rpc/notification_socket.rb
2019-10-14 09:45:06 +01:00

19 lines
367 B
Ruby

module Pipeline::Rpc
class NotificationSocket
attr_reader :socket
def initialize(zmq_context, port)
@zmq_context = zmq_context
@port = port
@socket = zmq_context.socket(ZMQ::PUB)
@socket.bind("tcp://*:#{@port}")
end
def emit_configuration(configuration)
@socket.send_string(configuration.to_json)
end
end
end