asyncio.ensure_future()

asyncio.ensure_future(coro_or_future, *, loop=None) Schedule the execution of a coroutine object: wrap it in a future. Return a Task object. If the argument is a Future, it is returned directly. New in version 3.4.4. Changed in version 3.5.1: The function accepts any awaitable object. See also The AbstractEventLoop.create_task() method.

asyncio.DatagramTransport.sendto()

DatagramTransport.sendto(data, addr=None) Send the data bytes to the remote peer given by addr (a transport-dependent target address). If addr is None, the data is sent to the target address given on transport creation. This method does not block; it buffers the data and arranges for it to be sent out asynchronously.

asyncio.DatagramTransport.abort()

DatagramTransport.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.DatagramProtocol.error_received()

DatagramProtocol.error_received(exc) Called when a previous send or receive operation raises an OSError. exc is the OSError instance. This method is called in rare conditions, when the transport (e.g. UDP) detects that a datagram couldn’t be delivered to its recipient. In many conditions though, undeliverable datagrams will be silently dropped.

asyncio.DatagramProtocol.datagram_received()

DatagramProtocol.datagram_received(data, addr) Called when a datagram is received. data is a bytes object containing the incoming data. addr is the address of the peer sending the data; the exact format depends on the transport.

asyncio.DatagramProtocol

class asyncio.DatagramProtocol The base class for implementing datagram protocols (for use with e.g. UDP transports).

asyncio.create_subprocess_shell()

coroutine asyncio.create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds) Run the shell command cmd. The limit parameter sets the buffer limit passed to the StreamReader. See AbstractEventLoop.subprocess_shell() for other parameters. Return a Process instance. It is the application’s responsibility to ensure that all whitespace and metacharacters are quoted appropriately to avoid shell injection vulnerabilities. The shlex.quote() function can be used

asyncio.create_subprocess_exec()

coroutine asyncio.create_subprocess_exec(*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds) Create a subprocess. The limit parameter sets the buffer limit passed to the StreamReader. See AbstractEventLoop.subprocess_exec() for other parameters. Return a Process instance. This function is a coroutine.

asyncio.coroutine()

@asyncio.coroutine Decorator to mark generator-based coroutines. This enables the generator use yield from to call async def coroutines, and also enables the generator to be called by async def coroutines, for instance using an await expression. There is no need to decorate async def coroutines themselves. If the generator is not yielded from before it is destroyed, an error message is logged. See Detect coroutines never scheduled.

asyncio.Condition.wait_for()

coroutine wait_for(predicate) Wait until a predicate becomes true. The predicate should be a callable which result will be interpreted as a boolean value. The final predicate value is the return value. This method is a coroutine.