def rebalance(max_workers, stagger_start = false)
      count = max_workers.to_i - living_count
      return 0 unless count > 0

      logger.info("#{'Stagger ' if stagger_start}Starting #{count} workers")

      add_one
      count -= 1
      delay = Config.instance.max_poll_seconds.to_f / max_workers

      count.times.each do
        sleep(delay) if stagger_start
        return -1 if Supervisor.shutdown?
        add_one
      end
    end
def rebalance(max_workers, stagger_start = false)
      count = max_workers.to_i - living_count
      return 0 unless count > 0

      logger.info("#{'Stagger ' if stagger_start}Starting #{count} workers")

      add_one
      count -= 1
      delay = Config.instance.max_poll_seconds.to_f / max_workers

      count.times.each do
        sleep(delay) if stagger_start
        return -1 if Supervisor.shutdown?
        add_one
      end
    end
Add new workers to get back to the `max_workers` if not already at `max_workers`
   Parameters
     stagger_start
       Whether to stagger when the workers poll for work the first time.
       It spreads out the queue polling over the max_poll_seconds so
       that not all workers poll at the same time.
       The worker also responds faster than max_poll_seconds when a new job is created.