MCPcopy Create free account
hub / github.com/vercel/vercel / __call__

Method __call__

python/vercel-runtime/src/vercel_runtime/vc_init.py:1388–1408  ·  view source on GitHub ↗

Build and run the ASGI instance. Receives the application and any body included in the request, then builds the ASGI instance using the connection scope. Runs until the response is completely read from the application.

(self, app: Any, body: bytes)

Source from the content-addressed store, hash-verified

1386 self.response: dict[str, Any] = {}
1387
1388 def __call__(self, app: Any, body: bytes) -> dict[str, Any]:
1389 """Build and run the ASGI instance.
1390
1391 Receives the application and any body
1392 included in the request, then builds the
1393 ASGI instance using the connection scope.
1394 Runs until the response is completely read
1395 from the application.
1396 """
1397 self.app_queue = asyncio.Queue()
1398 self.put_message(
1399 {
1400 "type": "http.request",
1401 "body": body,
1402 "more_body": False,
1403 }
1404 )
1405
1406 asgi_instance = app(self.scope, self.receive, self.send)
1407 _asgi_runner.run(asgi_instance)
1408 return self.response
1409
1410 def put_message(self, message: dict[str, Any]) -> None:
1411 self.app_queue.put_nowait(message)

Callers

nothing calls this directly

Calls 3

put_messageMethod · 0.95
appFunction · 0.70
runMethod · 0.65

Tested by

no test coverage detected