MCPcopy
hub / github.com/benoitc/gunicorn / app

Method app

tests/test_asgi_worker.py:285–296  ·  view source on GitHub ↗
(scope, receive, send)

Source from the content-addressed store, hash-verified

283 shutdown_called = False
284
285 async def app(scope, receive, send):
286 nonlocal startup_called, shutdown_called
287 assert scope["type"] == "lifespan"
288 while True:
289 message = await receive()
290 if message["type"] == "lifespan.startup":
291 startup_called = True
292 await send({"type": "lifespan.startup.complete"})
293 elif message["type"] == "lifespan.shutdown":
294 shutdown_called = True
295 await send({"type": "lifespan.shutdown.complete"})
296 return
297
298 manager = LifespanManager(app, mock.Mock())
299 await manager.startup()

Callers 6

_handle_http_requestMethod · 0.45
_handle_http2_requestMethod · 0.45
_run_lifespanMethod · 0.45
runMethod · 0.45
_handleMethod · 0.45
__call__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected