from ..types import StartupShutdownType decorated_startup: list[StartupShutdownType] = [] decorated_shutdown: list[StartupShutdownType] = [] def on_startup(fn: StartupShutdownType) -> StartupShutdownType: decorated_startup.append(fn) return fn def on_shutdown(fn: StartupShutdownType) -> StartupShutdownType: decorated_shutdown.append(fn) return fn