lib/ruote/worker.rb
def take_a_rest

      return if @sleep_time == nil

      if @processed_msgs < 1

        @sleep_time += 0.001
        @sleep_time = 0.499 if @sleep_time > 0.499

        sleep(@sleep_time)

      else

        @sleep_time = 0.000
      end
    end
# In order not to hammer the storage for msgs too much, take a rest.
#
# If the number of processed messages is more than zero, there are probably
# more msgs coming, no time for a rest...
#
# If @sleep_time is nil (restless_worker option set to true), the worker
# will never rest.
#
In order not to hammer the storage for msgs too much, take a rest.
If the number of processed messages is more than zero, there are probably
more msgs coming, no time for a rest

If @sleep_time is nil (restless_worker option set to true), the worker
will never rest.
In order not to hammer the storage for msgs too much take a rest . If the number of processed messages is more than zero there are probably more msgs coming no time for a rest If @sleep_time is nil ( restless_worker option set to true ) the worker will never rest .
def take_a_rest
      return if @sleep_time == nil
      if @processed_msgs < 1
        @sleep_time += 0.001
        @sleep_time = 0.499 if @sleep_time > 0.499
        sleep(@sleep_time)
      else
        @sleep_time = 0.000
      end
    end
def take_a_rest return if @sleep_time == nil if @processed_msgs < 1 @sleep_time += 0.001 @sleep_time = 0.499 if @sleep_time > 0.499 sleep ( @sleep_time ) else @sleep_time = 0.000 end end
In order not to hammer the storage for msgs too much, take a rest.
In order not to hammer the storage for msgs too much take a rest .