def push(job)
      if job.is_a? Array
        job.each { |j| self.push(j) }
      elsif job.respond_to? :call
        @jobs_count.increment
        if @latent && !@started
          @job_queue << job
        else
          send_to_threadpool(job)
        end
      else
        raise "Not a valid job: needs to support #call"
      end
    end
def push(job)
      if job.is_a? Array
        job.each { |j| self.push(j) }
      elsif job.respond_to? :call
        @jobs_count.increment
        if @latent && !@started
          @job_queue << job
        else
          send_to_threadpool(job)
        end
      else
        raise "Not a valid job: needs to support #call"
      end
    end
Creates a new batch attached to the given threadpool.  A number of options
 are available:
 :latent [false]:: If latent, none of the jobs in the batch will actually start
                   executing until the #start method is called.
 :max_retries [0]:: Specifies the maximum number of times to automatically retry a failed
                    job.  Defaults to 0.
 :error_handler [nil]:: Specifies the error handler to be invoked in the case of an error.
                        It will be called like so: handler.call(error, control) where +error+ is the underlying error and
                        +control+ is a Control for the job that had the error.
 Add a new job to the batch.  If this is a latent batch, the job won't
 be scheduled until the batch is #start'ed; otherwise it may start
 immediately.  The job can be anything that responds to +call+ or an
 array of objects that respond to +call+.