Module: anynet.scheduler

Provides a class that schedules events after a certain amount of time.

async with create() -> Scheduler
Creates a scheduler. All events are canceled when the context manager exits.

Scheduler

def schedule(function: Callable, delay: float, *args) -> int
Schedules an asynchronous function call after delay seconds. Returns a handle that can be passed to remove().

def repeat(function: Callable, delay: float, *args) -> int
Schedules an asynchronous function call after delay seconds. The call is repeated every delay seconds. Returns a handle that can be passed to remove().

def remove(handle: int) -> None
Cancels an event. Does nothing if handle is invalid.

def remove_all() -> None
Cancels all events.