Skip to content

__aexit__

Close the subscription when leaving an async with block, including when the block exits because of an exception.

Close the subscription when leaving an async with block.

Source code in src/herdr_client/async_client/client.py
140
141
142
143
144
145
146
147
async def __aexit__(
    self,
    exc_type: type[BaseException] | None,
    exc: BaseException | None,
    traceback: TracebackType | None,
) -> None:
    """Close the subscription when leaving an ``async with`` block."""
    await self.aclose()