MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / lifespan

Function lifespan

examples/adk-cloud-webhook/webhook.py:73–80  ·  view source on GitHub ↗
(_: FastAPI)

Source from the content-addressed store, hash-verified

71
72@asynccontextmanager
73async def lifespan(_: FastAPI) -> AsyncIterator[None]:
74 # Lazy-init shared resources once per process.
75 app.state.e2a = E2AClient()
76 app.state.sessions = InMemorySessionService()
77 app.state.runner = Runner(
78 agent=agent, app_name=APP_NAME, session_service=app.state.sessions
79 )
80 yield
81
82
83app = FastAPI(title="ADK + e2a webhook", lifespan=lifespan)

Callers

nothing calls this directly

Calls 2

E2AClientClass · 0.90
RunnerClass · 0.50

Tested by

no test coverage detected