public JupyterRequestContextHandler(IKernel kernel, JupyterFrontendEnvironment frontendEnvironment)
        {
            FrontendEnvironment = frontendEnvironment;

            var scheduler = new EventLoopScheduler(t =>
            {
                var thread = new Thread(t)
                {
                    IsBackground = true, Name = "MessagePump"
                };
                return(thread);
            });

            _executeHandler    = new ExecuteRequestHandler(kernel, frontendEnvironment, scheduler);
            _completeHandler   = new CompleteRequestHandler(kernel, frontendEnvironment, scheduler);
            _interruptHandler  = new InterruptRequestHandler(kernel, frontendEnvironment, scheduler);
            _isCompleteHandler = new IsCompleteRequestHandler(kernel, frontendEnvironment, scheduler);
        }
 protected RequestHandlerBase(IKernel kernel, IScheduler scheduler, JupyterFrontendEnvironment frontendEnvironment)
 {
     Kernel = kernel ?? throw new ArgumentNullException(nameof(kernel));
     FrontendEnvironment = frontendEnvironment ?? throw new ArgumentNullException(nameof(frontendEnvironment));
     KernelEvents        = Kernel.KernelEvents.ObserveOn(scheduler ?? throw new ArgumentNullException(nameof(scheduler)));
 }
 public CompleteRequestHandler(IKernel kernel, JupyterFrontendEnvironment frontendEnvironment, IScheduler scheduler = null)
     : base(kernel, scheduler ?? CurrentThreadScheduler.Instance, frontendEnvironment)
 {
 }