`_on_request` wrapped in `dispatch_middleware`, outermost-first. Dispatch-tier middleware sees raw `(dctx, method, params) -> dict` and wraps everything - initialize, METHOD_NOT_FOUND, validation failures included.
(self)
| 200 | |
| 201 | @cached_property |
| 202 | def on_request(self) -> OnRequest: |
| 203 | """`_on_request` wrapped in `dispatch_middleware`, outermost-first. |
| 204 | |
| 205 | Dispatch-tier middleware sees raw `(dctx, method, params) -> dict` and |
| 206 | wraps everything - initialize, METHOD_NOT_FOUND, validation failures |
| 207 | included. |
| 208 | """ |
| 209 | return reduce( |
| 210 | lambda handler, middleware: middleware(handler), reversed(self.dispatch_middleware), self._on_request |
| 211 | ) |
| 212 | |
| 213 | @cached_property |
| 214 | def on_notify(self) -> OnNotify: |