public async Task <ICommandDeliveryResult> Handle(
            ICommandDelivery <JupyterRequestContext> delivery)
        {
            switch (delivery.Command.JupyterRequestMessageEnvelope.Content)
            {
            case ExecuteRequest _:
                await _executeHandler.Handle(delivery.Command);

                break;

            case CompleteRequest _:
                await _completeHandler.Handle(delivery.Command);

                break;

            case InterruptRequest _:
                await _interruptHandler.Handle(delivery.Command);

                break;

            case IsCompleteRequest _:
                await _isCompleteHandler.Handle(delivery.Command);

                break;

            case ShutdownRequest _:
                await _shutdownHandler.Handle(delivery.Command);

                break;
            }

            delivery.Command.Complete();

            return(delivery.Complete());
        }
Example #2
0
        public async Task <ICommandDeliveryResult> Handle(
            ICommandDelivery <JupyterRequestContext> delivery)
        {
            switch (delivery.Command.Request.Content)
            {
            case ExecuteRequest _:
                await _executeHandler.Handle(delivery.Command);

                break;

            case CompleteRequest _:
                await _completeHandler.Handle(delivery.Command);

                break;

            case InterruptRequest _:
                await _interruptHandler.Handle(delivery.Command);

                break;

            case IsCompleteRequest _:
                await _isCompleteHandler.Handle(delivery.Command);

                break;

            default:
                break;
            }

            delivery.Command.Complete();

            return(delivery.Complete());
        }
        public async Task <ICommandDeliveryResult> Handle(
            ICommandDelivery <JupyterRequestContext> delivery)
        {
            switch (delivery.Command.Request.Header.MessageType)
            {
            case MessageTypeValues.ExecuteRequest:
                await _executeHandler.Handle(delivery.Command);

                break;

            case MessageTypeValues.CompleteRequest:
                await _completeHandler.Handle(delivery.Command);

                break;

            case MessageTypeValues.InterruptRequest:
                await _interruptHandler.Handle(delivery.Command);

                break;

            case MessageTypeValues.IsCompleteRequest:
                await _isCompleteHandler.Handle(delivery.Command);

                break;
            }

            return(delivery.Complete());
        }
        public async Task Handle(JupyterRequestContext context)
        {
            switch (context.JupyterRequestMessageEnvelope.Content)
            {
            case ExecuteRequest _:
                await _executeHandler.Handle(context);

                break;

            case CompleteRequest _:
                await _completeHandler.Handle(context);

                break;

            case InterruptRequest _:
                await _interruptHandler.Handle(context);

                break;

            case IsCompleteRequest _:
                await _isCompleteHandler.Handle(context);

                break;

            case ShutdownRequest _:
                await _shutdownHandler.Handle(context);

                break;
            }

            context.Complete();
        }