def work_with_multithreading(interval = 5.0, &block)
      work_without_multithreading(interval, &block)
      loop do
        #hang onto the process until all threads are done
        break if all_workers_in_pid_working.blank?
        sleep interval.to_i
      end
    end
def work_with_multithreading(interval = 5.0, &block)
      work_without_multithreading(interval, &block)
      loop do
        #hang onto the process until all threads are done
        break if all_workers_in_pid_working.blank?
        sleep interval.to_i
      end
    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 an integer 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.
OVERRIDE for multithreaded workers