Skip to content

__exit__

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

Close the subscription when leaving a with block.

Source code in src/herdr_client/sync/client.py
131
132
133
134
135
136
137
138
def __exit__(
    self,
    exc_type: type[BaseException] | None,
    exc: BaseException | None,
    traceback: TracebackType | None,
) -> None:
    """Close the subscription when leaving a ``with`` block."""
    self.close()