Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove IKernelConnector #3108

Merged
merged 4 commits into from
Jul 27, 2023
Merged

Conversation

jonsequitur
Copy link
Contributor

No description provided.

var localName = commandLineContext.ParseResult.GetValueForOption(KernelNameOption);
var kernel = await connector.CreateKernelAsync(localName);
var kernel1 = new SQLiteKernel($"sql-{localName}", connectionString);
var kernel = await Task.FromResult<Kernel>(kernel1);
return new[] { kernel };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The await is a bit confusing. Why not remove the async keyword and say something like return Task.FromResult(new [] { new SQLiteKernel($"sql-{localName}", connectionString) });?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a weird artifact of the inlining refactoring. Fixed.

{
CreateRemoteKernelTopology(_pipeName);

var connector = new NamedPipeKernelConnector(_pipeName);

RegisterForDisposal(connector);

return connector;
return name => connector.CreateKernelAsync(name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be simplified to return connector.CreateKernelAsync?

@@ -133,7 +133,7 @@ public async Task fast_path_commands_over_proxy_can_be_handled()
{
var connector = CreateConnector();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: Also rename this variable from connector to createKernel to match the above test?

/// <remarks>
/// TODO: Does it even make sense to implement <see cref="IKernelConnector"/> here considering that we have
/// concepts (such as a single root <see cref="ProxyKernel"/>, and zero or more (child) <see cref="ProxyKernel"/>s)
/// that the <see cref="IKernelConnector"/> abstraction does not understand / support? Should the '#!connect stdio'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - any changes in our thoughts around the #!connect stdio? Can we remove that too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might still want this, especially as project integration comes along and we think about .NET Interactive instances for other TFMs, different dependency graphs, etc.

@jonsequitur jonsequitur enabled auto-merge (squash) July 26, 2023 23:48
@jonsequitur jonsequitur merged commit 1a2ef3e into dotnet:main Jul 27, 2023
4 checks passed
@colombod colombod added breaking change A pr that introduces a breaking change for users Area-API labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-API breaking change A pr that introduces a breaking change for users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants