-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9d7cd5
commit 4aed351
Showing
52 changed files
with
1,725 additions
and
1,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 17 additions & 15 deletions
32
src/Microsoft.DotNet.Interactive.Jupyter/Connection/CommandToJupyterMessageHandlerBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
using Microsoft.DotNet.Interactive.Commands; | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.DotNet.Interactive.Commands; | ||
using Microsoft.DotNet.Interactive.Jupyter.Messaging; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection | ||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection; | ||
|
||
internal abstract class CommandToJupyterMessageHandlerBase<TCommand> : IKernelCommandToMessageHandler<TCommand> where TCommand: KernelCommand | ||
{ | ||
internal abstract class CommandToJupyterMessageHandlerBase<TCommand> : IKernelCommandToMessageHandler<TCommand> where TCommand: KernelCommand | ||
{ | ||
private readonly IMessageSender _sender; | ||
private readonly IMessageReceiver _receiver; | ||
private readonly IMessageSender _sender; | ||
private readonly IMessageReceiver _receiver; | ||
|
||
public CommandToJupyterMessageHandlerBase(IMessageSender sender, IMessageReceiver reciever) | ||
{ | ||
_receiver = reciever; | ||
_sender = sender; | ||
} | ||
public CommandToJupyterMessageHandlerBase(IMessageSender sender, IMessageReceiver reciever) | ||
{ | ||
_receiver = reciever; | ||
_sender = sender; | ||
} | ||
|
||
protected IMessageReceiver Receiver => _receiver; | ||
protected IMessageReceiver Receiver => _receiver; | ||
|
||
protected IMessageSender Sender => _sender; | ||
protected IMessageSender Sender => _sender; | ||
|
||
public abstract Task HandleCommandAsync(TCommand command, ICommandExecutionContext context, CancellationToken token); | ||
} | ||
public abstract Task HandleCommandAsync(TCommand command, ICommandExecutionContext context, CancellationToken token); | ||
} |
19 changes: 8 additions & 11 deletions
19
src/Microsoft.DotNet.Interactive.Jupyter/Connection/ICommandExecutionContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
using Microsoft.DotNet.Interactive.Events; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection | ||
using Microsoft.DotNet.Interactive.Events; | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection; | ||
|
||
internal interface ICommandExecutionContext | ||
{ | ||
internal interface ICommandExecutionContext | ||
{ | ||
void Publish(KernelEvent kernelEvent); | ||
} | ||
void Publish(KernelEvent kernelEvent); | ||
} |
16 changes: 9 additions & 7 deletions
16
src/Microsoft.DotNet.Interactive.Jupyter/Connection/IJupyterConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
using Microsoft.DotNet.Interactive.Jupyter.Messaging; | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.DotNet.Interactive.Jupyter.Messaging; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection | ||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection; | ||
|
||
public interface IJupyterConnection : IDisposable | ||
{ | ||
public interface IJupyterConnection : IDisposable | ||
{ | ||
Uri TargetUri { get; } | ||
Uri TargetUri { get; } | ||
|
||
Task<IJupyterKernelConnection> CreateKernelConnectionAsync(string kernelSpec); | ||
} | ||
Task<IJupyterKernelConnection> CreateKernelConnectionAsync(string kernelSpec); | ||
} |
18 changes: 10 additions & 8 deletions
18
src/Microsoft.DotNet.Interactive.Jupyter/Connection/IJupyterKernelConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
using Microsoft.DotNet.Interactive.Jupyter.Messaging; | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.DotNet.Interactive.Jupyter.Messaging; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection | ||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection; | ||
|
||
public interface IJupyterKernelConnection : IDisposable | ||
{ | ||
public interface IJupyterKernelConnection : IDisposable | ||
{ | ||
Task StartAsync(); | ||
Task StartAsync(); | ||
|
||
IMessageSender Sender { get; } | ||
IMessageSender Sender { get; } | ||
|
||
IMessageReceiver Receiver { get; } | ||
} | ||
IMessageReceiver Receiver { get; } | ||
} |
14 changes: 8 additions & 6 deletions
14
src/Microsoft.DotNet.Interactive.Jupyter/Connection/IKernelCommandToMessageHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
using Microsoft.DotNet.Interactive.Commands; | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Microsoft.DotNet.Interactive.Commands; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection | ||
namespace Microsoft.DotNet.Interactive.Jupyter.Connection; | ||
|
||
internal interface IKernelCommandToMessageHandler<TCommand> where TCommand: KernelCommand | ||
{ | ||
internal interface IKernelCommandToMessageHandler<TCommand> where TCommand: KernelCommand | ||
{ | ||
Task HandleCommandAsync(TCommand command, ICommandExecutionContext context, CancellationToken token); | ||
} | ||
Task HandleCommandAsync(TCommand command, ICommandExecutionContext context, CancellationToken token); | ||
} |
Oops, something went wrong.