Skip to main content

asyncio

Standard library Module View source
class WorkNode
class WorkNode
Fields 4
work WorkItem
prev Optional[WorkNode]
next Optional[WorkNode]
queued bool
Constructors 1
__init__
__init__(self: Self, work: WorkItem)
Methods 1
cancelled
cancelled(self: Self)
class Timer
class Timer
Fields 2
work WorkItem
when float
Constructors 1
__init__
__init__(self: Self, work: WorkItem, when: float)
Methods 1
cancelled
cancelled(self: Self)
class TimerHandle
@tuple
class TimerHandle
Methods 3
cancel
cancel(self: Self)
cancelled
cancelled(self: Self)
when
when(self: Self)
class WorkItem
@extend
class WorkItem
Constructors 5
__new__
__new__(coro: cobj)
__new__
__new__(coro: Coroutine)
__new__
__new__(task: Task)
__new__
__new__(state: _FutureState)
__new__
__new__()
Methods 1
cancelled
cancelled(self: Self)
class InvalidStateError
class InvalidStateError(Exception)
Constructors 1
__init__
__init__(self: Self, message: str = "", /)
class CancelledError
class CancelledError(BaseException)
Constructors 1
__init__
__init__(self: Self, message: str = "", /)
class EventLoop
@extend
class EventLoop
Constructors 1
__init__
__init__(self: Self)
Methods 13
close
close(self: Self)
time
time(self: Self)
stop
stop(self: Self)
is_running
is_running(self: Self)
is_closed
is_closed(self: Self)
call_soon
call_soon(self: Self, callback, *args)
call_soon_threadsafe
call_soon_threadsafe(self: Self, callback, *args)
call_later
call_later(self: Self, delay: float, callback, *args)
call_at
call_at(self: Self, when: float, callback, *args)
run_forever
run_forever(self: Self)
run_until_complete
run_until_complete(self: Self, future)
create_future
create_future[T: type = NoneType](self: Self)
create_task
create_task(self: Self, coro: Coroutine, *, name: Optional[str] = None)
class Future
@extend
class Future[R]
Constructors 1
__init__
__init__(self: Self, /, *, loop: Optional[EventLoop] = None)
Methods 9
add_done_callback
add_done_callback(self: Self, callback, /)
result
result(self: Self, /) -> R
set_result
set_result(self: Self, result: R, /)
set_exception
set_exception(self: Self, exception: BaseException, /)
cancelled
cancelled(self: Self, /)
done
done(self: Self, /)
cancel
cancel(self: Self, /, msg: Optional[str] = None)
get_loop
get_loop(self: Self, /)
exception
exception(self: Self, /) -> Optional[BaseException]
Special methods 1
__await__
@async
__await__(self: Self, /)
class Task
@extend
class Task[R]
Constructors 1
__init__
__init__(self: Self, /, coro: Coroutine[R], *, loop: Optional[EventLoop] = None, name: Optional[str] = None)
Methods 4
get_name
get_name(self: Self, /)
set_name
set_name(self: Self, value: str, /)
get_coro
get_coro[T: type = NoneType](self: Self, /) -> Coroutine[T]
result
result(self: Self, /)
function new_event_loop
new_event_loop()
function set_event_loop
set_event_loop(loop: EventLoop)
function get_event_loop
get_event_loop()
function get_running_loop
get_running_loop() -> EventLoop
function create_task
create_task(coro, *, name: Optional[str] = None)
function isfuture
isfuture(obj) -> Literal[bool]
function iscoroutine
iscoroutine(obj) -> Literal[bool]
function ensure_future
ensure_future(obj, *, loop: Optional[EventLoop] = None)
function current_task
current_task() -> Optional[Task[None]]
function run
run(coro, *, debug = None, loop_factory = None)
function sleep
@async
sleep(delay: float, result = None)
function gather
gather(*aws)