lib/pigato/worker.rb in pigato-0.2.10 vs lib/pigato/worker.rb in pigato-0.2.11
- old
+ new
@@ -77,13 +77,16 @@
def reconnect_to_broker
if @socket
@socket.close
end
+ if @ctx
+ @ctx.destroy
+ end
- @context = ZMQ::Context.new
- @socket = @context.socket ZMQ::DEALER
- @context.linger = 0
+ @ctx = ZMQ::Context.new
+ @socket = @ctx.socket ZMQ::DEALER
+ @ctx.linger = 0
@socket.identity = SecureRandom.uuid
@socket.connect @broker
@socket.rcvtimeo = @timeout;
send_to_broker Pigato::W_READY, @service
@liveness = HEARTBEAT_LIVENESS