asyncio.Queue.qsize()

qsize() Number of items in the queue.

asyncio.Queue.get()

coroutine get() Remove and return an item from the queue. If queue is empty, wait until an item is available. This method is a coroutine. See also The empty() method.

asyncio.Queue.join()

coroutine join() Block until all items in the queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer thread calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks. This method is a coroutine. New in version 3.4.4.

asyncio.Queue.get_nowait()

get_nowait() Remove and return an item from the queue. Return an item if one is immediately available, else raise QueueEmpty.

asyncio.Queue.put_nowait()

put_nowait(item) Put an item into the queue without blocking. If no free slot is immediately available, raise QueueFull.

asyncio.Queue.maxsize

maxsize Number of items allowed in the queue.

asyncio.Queue.full()

full() Return True if there are maxsize items in the queue. Note If the Queue was initialized with maxsize=0 (the default), then full() is never True.

asyncio.Queue

class asyncio.Queue(maxsize=0, *, loop=None) A queue, useful for coordinating producer and consumer coroutines. If maxsize is less than or equal to zero, the queue size is infinite. If it is an integer greater than 0, then yield from put() will block when the queue reaches maxsize, until an item is removed by get(). Unlike the standard library queue, you can reliably know this Queue’s size with qsize(), since your single-threaded asyncio application won’t be interrupted between calling qsize

asyncio.Queue.empty()

empty() Return True if the queue is empty, False otherwise.

asyncio.Protocol.data_received()

Protocol.data_received(data) Called when some data is received. data is a non-empty bytes object containing the incoming data. Note Whether the data is buffered, chunked or reassembled depends on the transport. In general, you shouldn’t rely on specific semantics and instead make your parsing generic and flexible enough. However, data is always received in the correct order.