예제 #1
0
        private void OnExecutionInterrupted(IJupyterMessageSender jupyterMessageSender)
        {
            // reply
            var interruptReplyPayload = new InterruptReply();

            // send to server
            jupyterMessageSender.Send(interruptReplyPayload);
        }
예제 #2
0
        private void OnExecutionInterrupted(CurrentCommandCancelled currentCommandCancelled, Message request, IMessageSender serverChannel)
        {
            // reply
            var interruptReplyPayload = new InterruptReply();

            // send to server
            var interruptReply = Message.CreateResponse(
                interruptReplyPayload,
                request);

            serverChannel.Send(interruptReply);
        }
        public Task Handle(JupyterRequestContext context)
        {
            KernelInvocationContext.Current?.Fail(
                new OperationCanceledException());

            // reply
            var interruptReplyPayload = new InterruptReply();

            // send to server
            context.JupyterMessageSender.Send(interruptReplyPayload);

            return(Task.CompletedTask);
        }
예제 #4
0
        private void OnExecutionInterrupted(CurrentCommandCancelled currentCommandCancelled)
        {
            if (InFlightRequests.TryRemove(currentCommandCancelled.Command, out var openRequest))
            {
                // reply
                var interruptReplyPayload = new InterruptReply();

                // send to server
                var interruptReply = Message.CreateResponse(
                    interruptReplyPayload,
                    openRequest.Context.Request);

                openRequest.Context.ServerChannel.Send(interruptReply);
                openRequest.Context.RequestHandlerStatus.SetAsIdle();
                openRequest.Dispose();
            }
        }