asyncio.Semaphore

class asyncio.Semaphore(value=1, *, loop=None) A Semaphore implementation. A semaphore manages an internal counter which is decremented by each acquire() call and incremented by each release() call. The counter can never go below zero; when acquire() finds that it is zero, it blocks, waiting until some other coroutine calls release(). Semaphores also support the context management protocol. The optional argument gives the initial value for the internal counter; it defaults to 1. If the value

asyncio.SelectorEventLoop

class asyncio.SelectorEventLoop Event loop based on the selectors module. Subclass of AbstractEventLoop. Use the most efficient selector available on the platform. On Windows, only sockets are supported (ex: pipes are not supported): see the MSDN documentation of select.

asyncio.run_coroutine_threadsafe()

asyncio.run_coroutine_threadsafe(coro, loop) Submit a coroutine object to a given event loop. Return a concurrent.futures.Future to access the result. This function is meant to be called from a different thread than the one where the event loop is running. Usage: # Create a coroutine coro = asyncio.sleep(1, result=3) # Submit the coroutine to a given loop future = asyncio.run_coroutine_threadsafe(coro, loop) # Wait for the result with an optional timeout argument assert future.result(timeout

asyncio.ReadTransport.resume_reading()

resume_reading() Resume the receiving end. The protocol’s data_received() method will be called once again if some data is available for reading.

asyncio.ReadTransport.pause_reading()

pause_reading() Pause the receiving end of the transport. No data will be passed to the protocol’s data_received() method until resume_reading() is called.

asyncio.ReadTransport

class asyncio.ReadTransport Interface for read-only transports. pause_reading() Pause the receiving end of the transport. No data will be passed to the protocol’s data_received() method until resume_reading() is called. resume_reading() Resume the receiving end. The protocol’s data_received() method will be called once again if some data is available for reading.

asyncio.QueueFull

exception asyncio.QueueFull Exception raised when the put_nowait() method is called on a Queue object which is full.

asyncio.QueueEmpty

exception asyncio.QueueEmpty Exception raised when the get_nowait() method is called on a Queue object which is empty.

asyncio.Queue.task_done()

task_done() Indicate that a formerly enqueued task is complete. Used by queue consumers. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises ValueError if called more times than there were items placed in the queue. New in ver

asyncio.Queue.qsize()

qsize() Number of items in the queue.