asyncio.shield()

asyncio.shield(arg, *, loop=None) Wait for a future, shielding it from cancellation. The statement: res = yield from shield(something()) is exactly equivalent to the statement: res = yield from something() except that if the coroutine containing it is cancelled, the task running in something() is not cancelled. From the point of view of something(), the cancellation did not happen. But its caller is still cancelled, so the yield-from expression still raises CancelledError. Note: If somethi

asyncio.set_event_loop_policy()

asyncio.set_event_loop_policy(policy) Set the current event loop policy. If policy is None, the default policy is restored.

asyncio.set_event_loop()

asyncio.set_event_loop(loop) Equivalent to calling get_event_loop_policy().set_event_loop(loop).

asyncio.Server.wait_closed()

coroutine wait_closed() Wait until the close() method completes. This method is a coroutine.

asyncio.Server.sockets

sockets List of socket.socket objects the server is listening to, or None if the server is closed.

asyncio.Server.close()

close() Stop serving: close listening sockets and set the sockets attribute to None. The sockets that represent existing incoming client connections are left open. The server is closed asynchronously, use the wait_closed() coroutine to wait until the server is closed.

asyncio.Server

class asyncio.Server Server listening on sockets. Object created by the AbstractEventLoop.create_server() method and the start_server() function. Don’t instantiate the class directly. close() Stop serving: close listening sockets and set the sockets attribute to None. The sockets that represent existing incoming client connections are left open. The server is closed asynchronously, use the wait_closed() coroutine to wait until the server is closed. coroutine wait_closed() Wait until

asyncio.Semaphore.release()

release() Release a semaphore, incrementing the internal counter by one. When it was zero on entry and another coroutine is waiting for it to become larger than zero again, wake up that coroutine.

asyncio.Semaphore.locked()

locked() Returns True if semaphore can not be acquired immediately.

asyncio.Semaphore.acquire()

coroutine acquire() Acquire a semaphore. If the internal counter is larger than zero on entry, decrement it by one and return True immediately. If it is zero on entry, block, waiting until some other coroutine has called release() to make it larger than 0, and then return True. This method is a coroutine.