asyncio.WriteTransport

class asyncio.WriteTransport Interface for write-only transports. abort() Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol’s connection_lost() method will eventually be called with None as its argument. can_write_eof() Return True if the transport supports write_eof(), False if not. get_write_buffer_size() Return the current size of the output buffer used by the transpor

asyncio.WriteTransport.abort()

abort() Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol’s connection_lost() method will eventually be called with None as its argument.

asyncio.wait_for()

coroutine asyncio.wait_for(fut, timeout, *, loop=None) Wait for the single Future or coroutine object to complete with timeout. If timeout is None, block until the future completes. Coroutine will be wrapped in Task. Returns result of the Future or coroutine. When a timeout occurs, it cancels the task and raises asyncio.TimeoutError. To avoid the task cancellation, wrap it in shield(). If the wait is cancelled, the future fut is also cancelled. This function is a coroutine, usage: result = y

asyncio.WriteTransport.can_write_eof()

can_write_eof() Return True if the transport supports write_eof(), False if not.

asyncio.wait()

coroutine asyncio.wait(futures, *, loop=None, timeout=None, return_when=ALL_COMPLETED) Wait for the Futures and coroutine objects given by the sequence futures to complete. Coroutines will be wrapped in Tasks. Returns two sets of Future: (done, pending). The sequence futures must not be empty. timeout can be used to control the maximum number of seconds to wait before returning. timeout can be an int or float. If timeout is not specified or None, there is no limit to the wait time. return_wh

asyncio.Task.all_tasks()

classmethod all_tasks(loop=None) Return a set of all tasks for an event loop. By default all tasks for the current event loop are returned.

asyncio.Task.get_stack()

get_stack(*, limit=None) Return the list of stack frames for this task’s coroutine. If the coroutine is not done, this returns the stack where it is suspended. If the coroutine has completed successfully or was cancelled, this returns an empty list. If the coroutine was terminated by an exception, this returns the list of traceback frames. The frames are always ordered from oldest to newest. The optional limit gives the maximum number of frames to return; by default all available frames are

asyncio.Task.print_stack()

print_stack(*, limit=None, file=None) Print the stack or traceback for this task’s coroutine. This produces output similar to that of the traceback module, for the frames retrieved by get_stack(). The limit argument is passed to get_stack(). The file argument is an I/O stream to which the output is written; by default output is written to sys.stderr.

asyncio.TimeoutError

exception asyncio.TimeoutError The operation exceeded the given deadline.

asyncio.Task.cancel()

cancel() Request that this task cancel itself. This arranges for a CancelledError to be thrown into the wrapped coroutine on the next cycle through the event loop. The coroutine then has a chance to clean up or even deny the request using try/except/finally. Unlike Future.cancel(), this does not guarantee that the task will be cancelled: the exception might be caught and acted upon, delaying cancellation of the task or preventing cancellation completely. The task may also return a value or r