lib/pigato/worker.rb in pigato-0.1.2 vs lib/pigato/worker.rb in pigato-0.1.3

- old
+ new

@@ -1,7 +1,8 @@ require "json" require "ffi-rzmq" +require "securerandom" class PigatoWorker HEARTBEAT_LIVENESS = 3 # 3-5 is reasonable def initialize broker, service @@ -85,10 +86,10 @@ @poller.deregister @worker, ZMQ::DEALER @worker.close end @worker = @context.socket ZMQ::DEALER - @worker.setsockopt ZMQ::IDENTITY, 'WRK01' + @worker.setsockopt ZMQ::IDENTITY, SecureRandom.uuid @worker.setsockopt ZMQ::LINGER, 0 @worker.connect @broker @poller.register @worker, ZMQ::POLLIN send_to_broker(Pigato::W_READY, @service, []) @liveness = HEARTBEAT_LIVENESS