(
method: string,
handler: (params: TParams) => TResult | Promise<TResult>,
)
| 350 | }, |
| 351 | |
| 352 | onRequest<TParams, TResult>( |
| 353 | method: string, |
| 354 | handler: (params: TParams) => TResult | Promise<TResult>, |
| 355 | ): void { |
| 356 | if (!connection) { |
| 357 | // Queue handler for application when connection is ready (lazy initialization) |
| 358 | pendingRequestHandlers.push({ |
| 359 | method, |
| 360 | handler: handler as (params: unknown) => unknown | Promise<unknown>, |
| 361 | }) |
| 362 | logForDebugging( |
| 363 | `Queued request handler for ${serverName}.${method} (connection not ready)`, |
| 364 | ) |
| 365 | return |
| 366 | } |
| 367 | |
| 368 | checkStartFailed() |
| 369 | |
| 370 | connection.onRequest(method, handler) |
| 371 | }, |
| 372 | |
| 373 | async stop(): Promise<void> { |
| 374 | let shutdownError: Error | undefined |
nothing calls this directly
no test coverage detected