'Start a delay to wait for more hosts to enter Pending state before
launching an atomic group job.  Once set, the a delay cannot be reset.
:param queue_entry: The HostQueueEntry object to get atomic group
info from and pass to run_if_ready when the delay is up.
:return: An Agent to run the job as appropriate or None if a delay
has already been set.'

def run_with_ready_delay(self, queue_entry):

    assert (queue_entry.job_id == self.id)
    assert queue_entry.atomic_group
    delay = scheduler_config.config.secs_to_wait_for_atomic_group_hosts
    over_max_threshold = (self._pending_count() >= self._max_hosts_needed_to_run(queue_entry.atomic_group))
    delay_expired = (self._delay_ready_task and (time.time() >= self._delay_ready_task.end_time))
    if ((not delay) or over_max_threshold or delay_expired):
        self.run(queue_entry)
    else:
        queue_entry.set_status(models.HostQueueEntry.Status.WAITING)
