Aiosetups (2024)

aiosetups is a conceptual / utility module that provides reusable patterns to async resources.

you use a setup registry.

async def close_postgres(resource): print(f"Closing resource") aiosetups

class AsyncSetup: """Register and manage async initializers and cleaners.""" def (self): self._init_tasks: List[Callable[[], Any]] = [] self._cleanup_tasks: List[Callable[[], Any]] = [] self._resources: Dict[str, Any] = {} aiosetups is a conceptual / utility module that

The term "AIO" in the context of technology—and specifically platforms like AIOSetups—refers to the consolidation of multiple components or functions into a single unit or interface. Any]] = [] self._cleanup_tasks: List[Callable[[]

async def main(): setup = AsyncSetup() setup.add("db", init_postgres, close_postgres) setup.add("cache", init_redis)