setRequestHandler
inline fun <T : Request> setRequestHandler(method: Method, noinline block: suspend (T, RequestHandlerExtra) -> RequestResult?)(source)
Registers a handler to invoke when this protocol object receives a request with the given method.
Note that this will replace any previous request handler for the same method.
Handlers may run concurrently after initialization and are cancelled cooperatively, so always re-throw CancellationException. Replacing a built-in control-method handler (ping, notifications/cancelled, notifications/progress, notifications/initialized) with slow code degrades connection liveness.