lib/test_queue/iterator.rb in test-queue-0.2.9 vs lib/test_queue/iterator.rb in test-queue-0.2.10
- old
+ new
@@ -14,11 +14,11 @@
@tcp_port = $2.to_i
end
end
def each
- fail 'already used this iterator' if @done
+ fail "already used this iterator. previous caller: #@done" if @done
while true
client = connect_to_master('POP')
break if client.nil?
r, w, e = IO.select([client], nil, [client], nil)
@@ -42,10 +42,10 @@
break
end
end
rescue Errno::ENOENT, Errno::ECONNRESET, Errno::ECONNREFUSED
ensure
- @done = true
+ @done = caller.first
File.open("/tmp/test_queue_worker_#{$$}_stats", "wb") do |f|
f.write Marshal.dump(@stats)
end
end