Futures — Python 3.16.0a0 documentation

docs.python.org

Tin mới

Transports and Protocols

Python Module Index

3.16.0a0 Documentation

The Python Standard Library

Networking and Interprocess Communication

asyncio — Asynchronous I/O

asyncio.iscoroutine

a Task object wrapping obj, if obj is a coroutine (iscoroutine() is used for the test); in this case the coroutine will be scheduled by ensure_future().

inspect.isawaitable()

a Task object that would await on obj, if obj is an awaitable (inspect.isawaitable() is used for the test.)

concurrent.futures.Future

Wrap a concurrent.futures.Future object in a asyncio.Future object.

loop.create_future()

A Future represents an eventual result of an asynchronous operation. Not thread-safe.

contextvars: Context Variables

Changed in version 3.7: Added support for the contextvars module.

asyncio.CancelledError

If the Future is done and has a result set by the set_result() method, the result value is returned.

functools.partial()

The callback is called with the Future object as its only argument.