@@ -459,30 +459,6 @@ async def handler(req: types.CompleteRequest):
459
459
460
460
return decorator
461
461
462
- async def _handle_message (
463
- self ,
464
- message : RequestResponder [types .ClientRequest , types .ServerResult ]
465
- | types .ClientNotification
466
- | Exception ,
467
- session : ServerSession ,
468
- lifespan_context : LifespanResultT ,
469
- raise_exceptions : bool = False ,
470
- ):
471
- with warnings .catch_warnings (record = True ) as w :
472
- match message :
473
- case (
474
- RequestResponder (request = types .ClientRequest (root = req )) as responder
475
- ):
476
- with responder :
477
- await self ._handle_request (
478
- message , req , session , lifespan_context , raise_exceptions
479
- )
480
- case types .ClientNotification (root = notify ):
481
- await self ._handle_notification (notify )
482
-
483
- for warning in w :
484
- logger .info (f"Warning: { warning .category .__name__ } : { warning .message } " )
485
-
486
462
async def run (
487
463
self ,
488
464
read_stream : MemoryObjectReceiveStream [types .JSONRPCMessage | Exception ],
@@ -512,6 +488,30 @@ async def run(
512
488
raise_exceptions ,
513
489
)
514
490
491
+ async def _handle_message (
492
+ self ,
493
+ message : RequestResponder [types .ClientRequest , types .ServerResult ]
494
+ | types .ClientNotification
495
+ | Exception ,
496
+ session : ServerSession ,
497
+ lifespan_context : LifespanResultT ,
498
+ raise_exceptions : bool = False ,
499
+ ):
500
+ with warnings .catch_warnings (record = True ) as w :
501
+ match message :
502
+ case (
503
+ RequestResponder (request = types .ClientRequest (root = req )) as responder
504
+ ):
505
+ with responder :
506
+ await self ._handle_request (
507
+ message , req , session , lifespan_context , raise_exceptions
508
+ )
509
+ case types .ClientNotification (root = notify ):
510
+ await self ._handle_notification (notify )
511
+
512
+ for warning in w :
513
+ logger .info (f"Warning: { warning .category .__name__ } : { warning .message } " )
514
+
515
515
async def _handle_request (
516
516
self ,
517
517
message : RequestResponder ,
0 commit comments