Fixup tests, refactor args

This commit is contained in:
Charles Care
2019-10-17 15:12:11 +01:00
parent 83390be80c
commit f9d1fed4c8
5 changed files with 10 additions and 7 deletions

View File

@@ -5,9 +5,10 @@ require 'securerandom'
class PipelineClient
attr_reader :context, :socket
attr_reader :address, :context, :socket
def initialize
def initialize(address="tcp://localhost:5555")
@address = address
@context = ZMQ::Context.new(1)
open_socket
at_exit do
@@ -18,7 +19,7 @@ class PipelineClient
def open_socket
@socket = context.socket(ZMQ::REQ)
@socket.setsockopt(ZMQ::LINGER, 0)
@socket.connect("tcp://localhost:5555")
@socket.connect(address)
end
def close_socket