def METHOD_NAME(self, task: ScheduledTask) -> None:
    """
    Schedules the given task. Requires that the task has a deadline set. It's better to use ``schedule_task``.
    :param task: the task to schedule.
    """
    if task.deadline is None:
        raise ValueError
    task._cancelled = False
    with self._condition:
        self._queue.put((task.deadline, task))
        self._condition.notify()