Files
typeshed/stdlib/sched.pyi
2021-12-28 11:31:43 +01:00

33 lines
942 B
Python

from typing import Any, Callable, NamedTuple
class Event(NamedTuple):
time: float
priority: Any
action: Callable[..., Any]
argument: tuple[Any, ...]
kwargs: dict[str, Any]
class scheduler:
def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ...
def enterabs(
self,
time: float,
priority: Any,
action: Callable[..., Any],
argument: tuple[Any, ...] = ...,
kwargs: dict[str, Any] = ...,
) -> Event: ...
def enter(
self,
delay: float,
priority: Any,
action: Callable[..., Any],
argument: tuple[Any, ...] = ...,
kwargs: dict[str, Any] = ...,
) -> Event: ...
def run(self, blocking: bool = ...) -> float | None: ...
def cancel(self, event: Event) -> None: ...
def empty(self) -> bool: ...
@property
def queue(self) -> list[Event]: ...