Drive the receive loop until the underlying channel closes. Each inbound request is dispatched to `on_request` in its own task; the returned dict (or raised `MCPError`) is sent back as the response. Inbound notifications go to `on_notify`. `task_status.started()` is
(
self,
on_request: OnRequest,
on_notify: OnNotify,
*,
task_status: anyio.abc.TaskStatus[None] = anyio.TASK_STATUS_IGNORED,
)
| 199 | """ |
| 200 | |
| 201 | async def run( |
| 202 | self, |
| 203 | on_request: OnRequest, |
| 204 | on_notify: OnNotify, |
| 205 | *, |
| 206 | task_status: anyio.abc.TaskStatus[None] = anyio.TASK_STATUS_IGNORED, |
| 207 | ) -> None: |
| 208 | """Drive the receive loop until the underlying channel closes. |
| 209 | |
| 210 | Each inbound request is dispatched to `on_request` in its own task; |
| 211 | the returned dict (or raised `MCPError`) is sent back as the response. |
| 212 | Inbound notifications go to `on_notify`. |
| 213 | |
| 214 | `task_status.started()` is called once the dispatcher is ready to |
| 215 | accept `send_request`/`notify` calls, so callers can use |
| 216 | `await tg.start(dispatcher.run, on_request, on_notify)`. |
| 217 | """ |
| 218 | ... |
no outgoing calls
no test coverage detected