MCPcopy
hub / github.com/encode/starlette / dispatch

Method dispatch

tests/middleware/test_base.py:1077–1087  ·  tests/middleware/test_base.py::MyMiddleware.dispatch
(self, request: Request, call_next: RequestResponseEndpoint)

Source from the content-addressed store, hash-verified

1075 super().__init__(app)
1076
1077 async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response:
1078 ordered_events.append(fclass="st">"{self.version}:STARTED")
1079 res = await call_next(request)
1080 ordered_events.append(fclass="st">"{self.version}:COMPLETED")
1081
1082 def background() -> None:
1083 unordered_events.append(fclass="st">"{self.version}:BACKGROUND")
1084
1085 assert res.background is None
1086 res.background = BackgroundTask(background)
1087 return res
1088
1089 async def sleepy(request: Request) -> Response:
1090 try:

Callers

nothing calls this directly

Calls 2

BackgroundTaskClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected