Module: anynet.queue

Provides a simple queue.

def create(size: int = math.inf) -> Queue
Creates a queue. If the queue is wrapped in an async with statement it is closed automatically.

Queue

async def put(value: object) -> None
Adds an item to the queue. Blocks if the queue is full.

async def get() -> object
Gets an item from the queue. Blocks if the queue is empty.

async def close() -> None
Closes the queue. No more items can be put into or obtained from the queue.

async def eof() -> None
Closes the queue. No more items can be put into the queue. Items that are already in queue can still be obtained with get().