asyncio API reference
102 public APIs from asyncio (python/asyncio) — 44 classes, 7 functions, 51 methods. Signatures extracted by static analysis of the actual source.
Repository: python/asyncio
| Kind | Count |
|---|---|
| Classes | 44 |
| Functions | 7 |
| Methods | 51 |
API list
func
asyncio.coroutines.coroutine(func)Decorator to mark coroutines.
func
asyncio.coroutines.iscoroutine(obj)Return True if obj is a coroutine object.
class
asyncio.events.AbstractEventLoopAbstract event loop.
method
asyncio.events.AbstractEventLoop.close()Close the loop.
class
asyncio.events.AbstractEventLoopPolicyAbstract policy for accessing the event loop.
class
asyncio.events.AbstractServerAbstract server returned by create_server().
method
asyncio.events.AbstractServer.close()Stop serving.
class
asyncio.events.BaseDefaultEventLoopPolicyDefault policy implementation for accessing the event loop.
method
asyncio.events.BaseDefaultEventLoopPolicy.get_event_loop()Get the event loop.
method
asyncio.events.BaseDefaultEventLoopPolicy.new_event_loop()Create a new event loop.
method
asyncio.events.BaseDefaultEventLoopPolicy.set_event_loop(loop)Set the event loop.
class
asyncio.events.HandleObject returned by callback registration methods.
class
asyncio.events.TimerHandleObject returned by timed callback registration methods.
func
asyncio.events.get_event_loop()Return an asyncio event loop.
func
asyncio.events.get_event_loop_policy()Get the current event loop policy.
func
asyncio.events.set_event_loop_policy(policy)Set the current event loop policy.
class
asyncio.futures.FutureThis class is *almost* compatible with concurrent.futures.Future.
method
asyncio.futures.Future.cancel()Cancel the future and schedule callbacks.
method
asyncio.futures.Future.cancelled()Return True if the future was cancelled.
method
asyncio.futures.Future.done()Return True if the future is done.
method
asyncio.futures.Future.result()Return the result this future represents.
method
asyncio.futures.Future.set_result(result)Mark the future done and set its result.
class
asyncio.futures.InvalidStateErrorThe operation is not allowed in this state.
func
asyncio.futures.isfuture(obj)Check for a Future.
func
asyncio.futures.wrap_future(future, *loop=None)Wrap concurrent.futures.Future object.
class
asyncio.locks.BoundedSemaphoreA bounded semaphore implementation.
class
asyncio.locks.ConditionAsynchronous equivalent to threading.Condition.
method
asyncio.locks.Condition.wait()Wait until notified.
method
asyncio.locks.Condition.wait_for(predicate)Wait until a predicate becomes true.
class
asyncio.locks.EventAsynchronous equivalent to threading.Event.
method
asyncio.locks.Event.clear()Reset the internal flag to false.
method
asyncio.locks.Event.set()Set the internal flag to true.
method
asyncio.locks.Event.wait()Block until the internal flag is true.
class
asyncio.locks.LockPrimitive lock objects.
method
asyncio.locks.Lock.acquire()Acquire a lock.
method
asyncio.locks.Lock.locked()Return True if lock is acquired.
method
asyncio.locks.Lock.release()Release a lock.
class
asyncio.locks.SemaphoreA Semaphore implementation.
method
asyncio.locks.Semaphore.acquire()Acquire a semaphore.
class
asyncio.protocols.BaseProtocolCommon base class for protocol interfaces.
method
asyncio.protocols.BaseProtocol.connection_made(transport)Called when a connection is made.
class
asyncio.protocols.DatagramProtocolInterface for datagram protocol.
class
asyncio.protocols.ProtocolInterface for stream protocol.
method
asyncio.protocols.Protocol.data_received(data)Called when some data is received.
class
asyncio.protocols.SubprocessProtocolInterface for protocol for subprocess calls.
method
asyncio.protocols.SubprocessProtocol.process_exited()Called when subprocess has exited.
class
asyncio.queues.QueueA queue, useful for coordinating producer and consumer coroutines.
method
asyncio.queues.Queue.empty()Return True if the queue is empty, False otherwise.
method
asyncio.queues.Queue.get()Remove and return an item from the queue.
method
asyncio.queues.Queue.get_nowait()Remove and return an item from the queue.
method
asyncio.queues.Queue.maxsize()Number of items allowed in the queue.
method
asyncio.queues.Queue.put(item)Put an item into the queue.
method
asyncio.queues.Queue.qsize()Number of items in the queue.
class
asyncio.selector_events.BaseSelectorEventLoopSelector event loop.
method
asyncio.selector_events.BaseSelectorEventLoop.add_reader(fd, callback, *args)Add a reader callback.
method
asyncio.selector_events.BaseSelectorEventLoop.add_writer(fd, callback, *args)Add a writer callback..
method
asyncio.selector_events.BaseSelectorEventLoop.remove_reader(fd)Remove a reader callback.
method
asyncio.selector_events.BaseSelectorEventLoop.remove_writer(fd)Remove a writer callback.
method
asyncio.selector_events.BaseSelectorEventLoop.sock_accept(sock)Accept a connection.
method
asyncio.selector_events.BaseSelectorEventLoop.sock_recv(sock, n)Receive data from the socket.
method
asyncio.selector_events.BaseSelectorEventLoop.sock_sendall(sock, data)Send data to the socket.
class
asyncio.selectors.BaseSelectorSelector abstract base class.
method
asyncio.selectors.BaseSelector.close()Close the selector.
method
asyncio.selectors.BaseSelector.register(fileobj, events, data=None)Register a file object.
method
asyncio.selectors.BaseSelector.unregister(fileobj)Unregister a file object.
class
asyncio.selectors.DevpollSelectorSolaris /dev/poll selector.
class
asyncio.selectors.EpollSelectorEpoll-based selector.
class
asyncio.selectors.KqueueSelectorKqueue-based selector.
class
asyncio.selectors.PollSelectorPoll-based selector.
class
asyncio.selectors.SelectSelectorSelect-based selector.
class
asyncio.sslproto.SSLProtocolSSL protocol.
class
asyncio.streams.FlowControlMixinReusable flow control logic for StreamWriter.drain().
class
asyncio.streams.IncompleteReadErrorIncomplete read error.
class
asyncio.streams.LimitOverrunErrorReached the buffer limit while looking for a separator.
method
asyncio.streams.StreamReader.read(n=-1)Read up to `n` bytes from the stream.
method
asyncio.streams.StreamReader.readexactly(n)Read exactly `n` bytes.
class
asyncio.streams.StreamReaderProtocolHelper class to adapt between Protocol and StreamReader.
class
asyncio.streams.StreamWriterWraps a Transport.
method
asyncio.streams.StreamWriter.drain()Flush the write buffer.
class
asyncio.subprocess.SubprocessStreamProtocolLike StreamReaderProtocol, but for a subprocess.
class
asyncio.transports.BaseTransportBase class for transports.
method
asyncio.transports.BaseTransport.close()Close the transport.
method
asyncio.transports.BaseTransport.get_protocol()Return the current protocol.
method
asyncio.transports.BaseTransport.set_protocol(protocol)Set a new protocol.
class
asyncio.transports.DatagramTransportInterface for datagram (UDP) transports.
method
asyncio.transports.DatagramTransport.abort()Close the transport immediately.
method
asyncio.transports.DatagramTransport.sendto(data, addr=None)Send data to the transport.
class
asyncio.transports.ReadTransportInterface for read-only transports.
method
asyncio.transports.ReadTransport.pause_reading()Pause the receiving end.
method
asyncio.transports.ReadTransport.resume_reading()Resume the receiving end.
class
asyncio.transports.TransportInterface representing a bidirectional transport.
class
asyncio.transports.WriteTransportInterface for write-only transports.
method
asyncio.transports.WriteTransport.abort()Close the transport immediately.
class
asyncio.unix_events.AbstractChildWatcherAbstract base class for monitoring child processes.
method
asyncio.unix_events.AbstractChildWatcher.close()Close the watcher.
class
asyncio.unix_events.FastChildWatcher'Fast' child watcher implementation.
class
asyncio.unix_events.SafeChildWatcher'Safe' child watcher implementation.
class
asyncio.windows_events.IocpProactorProactor implementation using IOCP.
method
asyncio.windows_events.IocpProactor.wait_for_handle(handle, timeout=None)Wait for a handle.
class
asyncio.windows_events.PipeServerClass representing a pipe server.
class
asyncio.windows_events.ProactorEventLoopWindows version of proactor event loop using IOCP.
class
asyncio.windows_utils.PopenReplacement for subprocess.Popen using overlapped pipe handles.
About this data
These signatures were extracted from the public source of python/asyncio
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.