11using System ;
22using System . IO . Pipelines ;
33using System . Linq ;
4+ using System . Reactive . Concurrency ;
45using System . Threading ;
56using System . Threading . Tasks ;
67using DryIoc ;
@@ -32,6 +33,8 @@ internal static IContainer AddJsonRpcServerCore<T>(this IContainer container, Js
3233 container . RegisterInstance ( options . MaximumRequestTimeout , serviceKey : nameof ( options . MaximumRequestTimeout ) ) ;
3334 container . RegisterInstance ( options . SupportsContentModified , serviceKey : nameof ( options . SupportsContentModified ) ) ;
3435 container . RegisterInstance ( options . Concurrency ?? - 1 , serviceKey : nameof ( options . Concurrency ) ) ;
36+ container . RegisterInstance ( options . InputScheduler , serviceKey : nameof ( options . InputScheduler ) ) ;
37+ container . RegisterInstance ( options . OutputScheduler , serviceKey : nameof ( options . OutputScheduler ) ) ;
3538 if ( options . CreateResponseException != null )
3639 {
3740 container . RegisterInstance ( options . CreateResponseException ) ;
@@ -40,15 +43,18 @@ internal static IContainer AddJsonRpcServerCore<T>(this IContainer container, Js
4043 container . RegisterMany < OutputHandler > (
4144 nonPublicServiceTypes : true ,
4245 made : Parameters . Of
43- . Type < PipeWriter > ( serviceKey : nameof ( options . Output ) ) ,
46+ . Type < PipeWriter > ( serviceKey : nameof ( options . Output ) )
47+ . Type < IScheduler > ( serviceKey : nameof ( options . OutputScheduler ) ) ,
4448 reuse : Reuse . Singleton
4549 ) ;
4650 container . Register < Connection > (
4751 made : new Made . TypedMade < Connection > ( ) . Parameters
4852 . Type < PipeReader > ( serviceKey : nameof ( options . Input ) )
4953 . Type < TimeSpan > ( serviceKey : nameof ( options . MaximumRequestTimeout ) )
5054 . Type < bool > ( serviceKey : nameof ( options . SupportsContentModified ) )
51- . Name ( "concurrency" , serviceKey : nameof ( options . Concurrency ) ) ,
55+ . Name ( "concurrency" , serviceKey : nameof ( options . Concurrency ) )
56+ . Type < IScheduler > ( serviceKey : nameof ( options . InputScheduler ) )
57+ ,
5258 reuse : Reuse . Singleton
5359 ) ;
5460
0 commit comments