lib/plezi/eventmachine/workers.rb in plezi-0.8.5 vs lib/plezi/eventmachine/workers.rb in plezi-0.8.6
- old
+ new
@@ -7,10 +7,11 @@
@stop = false
wait = Worker.get_wait
@thread = Thread.new { EventMachine.run wait until @stop }
end
def stop
+ @instances = -1
@stop = true
end
def join
stop
@thread.join rescue true
@@ -24,12 +25,9 @@
def self.get_wait
@primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
@instances ||= -1
@instances += 1 if @instances < 7
@primes[@instances] / 10.0
- end
- def self.reset_wait
- @instances = -1
end
end
end
end
\ No newline at end of file