def work(interval = 5.0, &block)
      interval = Float(interval)
      startup

      loop do
        break if shutdown?

        unless work_one_job(&block)
          break if interval.zero?
          log_with_severity :debug, "Sleeping for #{interval} seconds"
          procline paused? ? "Paused" : "Waiting for #{queues.join(',')}"
          sleep interval
        end
      end

      unregister_worker
    rescue Exception => exception
      return if exception.class == SystemExit && !@child && run_at_exit_hooks
      log_with_severity :error, "Failed to start worker : #{exception.inspect}"
      unregister_worker(exception)
    end
def work(interval = 5.0, &block)
      interval = Float(interval)
      startup

      loop do
        break if shutdown?

        unless work_one_job(&block)
          break if interval.zero?
          log_with_severity :debug, "Sleeping for #{interval} seconds"
          procline paused? ? "Paused" : "Waiting for #{queues.join(',')}"
          sleep interval
        end
      end

      unregister_worker
    rescue Exception => exception
      return if exception.class == SystemExit && !@child && run_at_exit_hooks
      log_with_severity :error, "Failed to start worker : #{exception.inspect}"
      unregister_worker(exception)
    end
This is the main workhorse method. Called on a Worker instance,
 it begins the worker life cycle.

 The following events occur during a worker's life cycle:

 1. Startup:   Signals are registered, dead workers are pruned,
               and this worker is registered.
 2. Work loop: Jobs are pulled from a queue and processed.
 3. Teardown:  This worker is unregistered.

 Can be passed a float representing the polling frequency.
 The default is 5 seconds, but for a semi-active site you may
 want to use a smaller value.

 Also accepts a block which will be passed the job as soon as it
 has completed processing. Useful for testing.