Release task (return to queue) with delay if specified

            :param delay: Time in seconds before task will become ready again
            :return: Task instance
975851
async def release(self, *, delay=None):
        
        return await self._tube.release(self._task_id, delay=delay)
973788
def wait_for_task(service, task, timeout_sec=120):
    """"""
    return time_wait(lambda: task_predicate(service, task), timeout_seconds=timeout_sec)
792864
def _queue_task(self, args):
        '''  '''
        if self._cancel_called:
            raise AsperaTransferQueueError("Cancel already called")
        elif self._wait_called:
            raise AsperaTransferQueueError("Cant queue items during wait")
        elif self.waiting_coordinator_count() >= self._config.max_submission_queue_size:
            raise AsperaTransferQueueError("Max queued items reached")
        else:
            _coordinator = AsperaTransferCoordinator(args)
            _components = {'meta': TransferMeta(args, transfer_id=args.transfer_id),
                           'coordinator': _coordinator}

            _transfer_future = AsperaTransferFuture(**_components)
            _coordinator.add_subscribers(args.subscribers, future=_transfer_future)
            _coordinator.add_done_callback(self.remove_aspera_coordinator,
                                           transfer_coordinator=_coordinator)
            self.append_waiting_queue(_coordinator)

            if not self._processing_thread:
                self._processing_thread = threading.Thread(target=self._process_waiting_queue)
                self._processing_thread.daemon = True
                self._processing_thread.start()

            self._wakeup_processing_thread()

        return _transfer_future
117460
def job_delayed(self, job, queue):
        
        delayed_until = job.delayed_until.hget()
        if delayed_until:
            try:
                delayed_until = compute_delayed_until(delayed_until=parse(delayed_until))
            except (ValueError, TypeError):
                delayed_until = None

        if not delayed_until:
            # by default delay it for 60 seconds
            delayed_until = compute_delayed_until(delayed_for=60)

        job.enqueue_or_delay(
            queue_name=queue._cached_name,
            delayed_until=delayed_until,
            queue_model=queue.__class__,
        )

        self.log(self.job_delayed_message(job, queue), level='warning')

        if hasattr(job, 'on_delayed'):
            job.on_delayed(queue)
329157
def wait(self, task_id):
        
        data = {
            'action': 'wait',
            'id': task_id
        }
        self.__send_pyobj(data)
        task = self.__recv_pyobj(notimeout=True)
        return task
1284717
public void scheduleTask(PyObject task, double delay) {
        mTimer.schedule(new PythonCallTimerTask(task), Math.round(delay * 1000));
    }
683555
def task_wait(meow, heartbeat, polling_interval, timeout, task_id, timeout_exit_code):
    
    task_wait_with_io(
        meow, heartbeat, polling_interval, timeout, task_id, timeout_exit_code
    )
357570
def wait_stop(self):
        
        if not self.running:
            return
        self.stop()
        try:
            yield from self._task
        except asyncio.CancelledError:
            pass
64868
function isTaskReady(task) {
  var after       = task.after || new Date().getTime();
  var delay       = task.delay || 0;

  return task.status === 'ready' &&
  ((after + delay) <= new Date().getTime()) &&
  !TaskLock.isTaskLocked(task);
}
1250740
def no_wait_release(self, connection: Connection):
        ''''''
        _logger.debug('No wait check in.')
        release_task = asyncio.get_event_loop().create_task(
            self.release(connection)
        )
        self._release_tasks.add(release_task)
241362
def delay(self, seconds=0, minutes=0, msg=None):
        
        delay_time = seconds + minutes * 60
        self._hw_manager.hardware.delay(delay_time)
229428
public function release($delay = 0)
    {
        parent::release($delay);

        $this->delete();

        $this->redis->release($this->queue, $this->job, $delay, $this->attempts() + 1);
    }
1247016
def wait_for_task(self, task, timeout=-1):
        
        self.__wait_task_completion(task, timeout)

        task = self.get(task)

        logger.debug("Waiting for task. Percentage complete: " + str(task.get('computedPercentComplete')))
        logger.debug("Waiting for task. Task state: " + str(task.get('taskState')))

        task_response = self.__get_task_response(task)
        logger.debug('Task completed')
        return task_response
589915
def runTask(self, task, timeout=None):
        
        # Initialize the task.
        task.initialize(self)

        # Start the task.
        task.start()

        # Lets other threads run
        time.sleep(0)

        # Wait for it to finish.
        res = task.wait(timeout=timeout)

        # Now we're done
        return res
1194004
def defer(self, timeout_seconds, callback):
        
        priority = 1
        event = self._scheduler.enter(timeout_seconds, priority, callback, ())
        return self._make_sched_handle(lambda: event)
1015144
def _timed_queue_join(self, timeout):
        
        deadline = time.time() + timeout

        with self._queue.all_tasks_done:
            while self._queue.unfinished_tasks:
                delay = deadline - time.time()
                if delay <= 0:
                    # timed out
                    return False

                self._queue.all_tasks_done.wait(timeout=delay)

            return True
1268643
def handle_delayed_messages(self):
        
        for eta, message in iter_queue(self.delay_queue):
            if eta > current_millis():
                self.delay_queue.put((eta, message))
                self.delay_queue.task_done()
                break

            queue_name = q_name(message.queue_name)
            new_message = message.copy(queue_name=queue_name)
            del new_message.options["eta"]

            self.broker.enqueue(new_message)
            self.post_process_message(message)
            self.delay_queue.task_done()