class documentation

class GracefulInterface(Protocol): (source)

View In Hierarchy

Protocol for components that support graceful asynchronous shutdown.

Objects implementing this protocol expose an close coroutine that the channel will call during shutdown to allow background tasks and resources to be released.

Async Method close Perform asynchronous shutdown of the component.
async def close(self, grace: float | None = None): (source) ΒΆ

Perform asynchronous shutdown of the component.

Parameters
grace:float | NoneOptional grace period in seconds for the component to complete shutdown work.