Пример #1
0
        public JupyterRequestContextHandler(
            PackageRegistry packageRegistry,
            IKernel kernel)
        {
            _executeHandler  = new ExecuteRequestHandler(kernel);
            _completeHandler = new CompleteRequestHandler(kernel);

            if (packageRegistry == null)
            {
                throw new ArgumentNullException(nameof(packageRegistry));
            }
            _server = new WorkspaceServerMultiplexer(packageRegistry);
        }
Пример #2
0
        public JupyterRequestContextHandler(
            IKernel kernel)
        {
            var scheduler = new EventLoopScheduler(t =>
            {
                var thread = new Thread(t)
                {
                    IsBackground = true, Name = "MessagePump"
                };
                return(thread);
            });

            _executeHandler  = new ExecuteRequestHandler(kernel, scheduler);
            _completeHandler = new CompleteRequestHandler(kernel, scheduler);
        }
        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);
        }
Пример #4
0
        public JupyterRequestContextHandler(
            PackageRegistry packageRegistry,
            IKernel kernel)
        {
            var scheduler = new EventLoopScheduler(t =>
            {
                var thread          = new Thread(t);
                thread.IsBackground = true;
                thread.Name         = "MessagePump";
                return(thread);
            });

            _executeHandler  = new ExecuteRequestHandler(kernel, scheduler);
            _completeHandler = new CompleteRequestHandler(kernel, scheduler);

            if (packageRegistry == null)
            {
                throw new ArgumentNullException(nameof(packageRegistry));
            }
            _server = new WorkspaceServerMultiplexer(packageRegistry);
        }