Skip to content

MultiLock

faststream.broker.handler.MultiLock #

MultiLock()

A class representing a multi lock.

Initialize a new instance of the class.

Source code in faststream/broker/handler.py
def __init__(self) -> None:
    """Initialize a new instance of the class."""
    self.queue: "asyncio.Queue[None]" = asyncio.Queue()

empty property #

empty: bool

Return whether the queue is empty.

qsize property #

qsize: int

Return the size of the queue.

queue instance-attribute #

queue: Queue[None] = Queue()

wait_release async #

wait_release(timeout: Optional[float] = None) -> None

Wait for the queue to be released.

Source code in faststream/broker/handler.py
async def wait_release(self, timeout: Optional[float] = None) -> None:
    """Wait for the queue to be released."""
    if timeout:
        with anyio.move_on_after(timeout):
            await self.queue.join()