diff --git a/src/dependency_injector/resources.py b/src/dependency_injector/resources.py index b5946cfa..2399079b 100644 --- a/src/dependency_injector/resources.py +++ b/src/dependency_injector/resources.py @@ -25,3 +25,13 @@ class AsyncResource(Generic[T], metaclass=abc.ABCMeta): async def shutdown(self, resource: Optional[T]) -> None: ... + + +class AsyncShutdownResource(Generic[T], metaclass=abc.ABCMeta): + + @abc.abstractmethod + def init(self, *args, **kwargs) -> Optional[T]: + ... + + async def shutdown(self, resource: Optional[T]) -> None: + ...