public static KernelClient CreateKernelClient(this NamedPipeClientStream remote)
        {
            if (remote == null)
            {
                throw new ArgumentNullException(nameof(remote));
            }

            var input        = new PipeStreamInputStream(remote);
            var output       = new PipeStreamOutputStream(remote);
            var kernelClient = new KernelClient(input, output);

            return(kernelClient);
        }
        public static KernelClient CreateKernelClient(this HubConnection hubConnection)
        {
            if (hubConnection == null)
            {
                throw new ArgumentNullException(nameof(hubConnection));
            }

            var input        = new SignalRInputTextStream(hubConnection);
            var output       = new SignalROutputTextStream(hubConnection);
            var kernelClient = new KernelClient(input, output);

            return(kernelClient);
        }
        public static KernelClient CreateKernelClient(this Process remote)
        {
            if (remote == null)
            {
                throw new ArgumentNullException(nameof(remote));
            }

            if (!remote.StartInfo.RedirectStandardInput || !remote.StartInfo.RedirectStandardOutput)
            {
                throw new InvalidOperationException("StandardInput and StandardOutput must be redirected");
            }

            var input        = new TextReaderInputStream(remote.StandardOutput);
            var output       = new TextWriterOutputStream(remote.StandardInput);
            var kernelClient = new KernelClient(input, output);

            return(kernelClient);
        }