lib/pigato/worker.rb in pigato-0.4.1 vs lib/pigato/worker.rb in pigato-0.4.2
- old
+ new
@@ -36,20 +36,25 @@
end
def recv
loop do
+ @reply_rid = nil
+ @reply_to = nil
+ @reply_service = nil
iid = get_iid
+
+ start if @@sockets[iid] == nil && @conf[:autostart]
- socket = get_socket
- return nil if socket.nil?
+ socket = get_socket
+ return nil if socket.nil?
- @reply_rid = nil
- @reply_to = nil
- @reply_service = nil
+ socket.rcvtimeo = @conf[:timeout]
- msg = socket.recv_message
+ msg = socket.recv_message
+
+ return nil if msg.nil?
if msg && msg.size
@liveness = HEARTBEAT_LIVENESS
header = msg.pop.data