Exemple #1
0
        public void Handle(Message message)
        {
            // Find out the thing we need to echo back.
            var value = (message.Content as UnknownContent).Data["value"] as string;

            // Send the echo both as an output and as a reply so that clients
            // can test both kinds of callbacks.
            shellServer.SendIoPubMessage(
                new Message
            {
                Header = new MessageHeader
                {
                    MessageType = "iqsharp_echo_output"
                },
                Content = new EchoReplyContent
                {
                    Value = value
                }
            }.AsReplyTo(message)
                );
            shellServer.SendShellMessage(
                new Message
            {
                Header = new MessageHeader
                {
                    MessageType = "iqsharp_echo_reply"
                },
                Content = new EchoReplyContent
                {
                    Value = value
                }
            }.AsReplyTo(message)
                );
        }
Exemple #2
0
 internal static void NotifyBusyStatus(this IShellServer shellServer, Message message, ExecutionState state)
 {
     // Begin by sending that we're busy.
     shellServer.SendIoPubMessage(
         new Message
     {
         Header = new MessageHeader
         {
             MessageType = "status"
         },
         Content = new KernelStatusContent
         {
             ExecutionState = state
         }
     }.AsReplyTo(message)
         );
 }