Skip to content

Conversation

@fabiocav
Copy link
Member

@fabiocav fabiocav commented Dec 6, 2022

Managed side of the custom host work introduced in #1212

The code here detects when running in the Functions .NET host and replaces the client to communicate through it.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@fabiocav fabiocav requested review from brettsam and kshyju December 6, 2022 21:16
@fabiocav fabiocav changed the title Fabiocav/nativehostintegration Native host integration Dec 6, 2022
@fabiocav
Copy link
Member Author

fabiocav commented Dec 6, 2022

Pending release notes update and documentation work.

Copy link
Member Author

Choose a reason for hiding this comment

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

@brettsam will remove this and replace with an issue link to address the logging at initialization

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding xml doc as part of making this public

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want CancellationToken on these APIs? Or is the cancellation inside StreamingMessage?

Same question for IWorkerClient.SendMessageAsync.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense for these interfaces to take in a CancellationToken. Will update

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of ValueTask<IWorkerClient> here? Considering one of our implementations is synchronous.

But also not a big deal at all as this is called once per worker I think?

Copy link
Contributor

Choose a reason for hiding this comment

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

As with the other csproj, I think the packages can be simplified to just Microsoft.Extensions.Hosting

@fabiocav fabiocav force-pushed the fabiocav/nativehostintegration branch from 8abaf8e to 5e23b34 Compare December 16, 2022 21:03
@fabiocav fabiocav force-pushed the fabiocav/nativehostintegration branch from 3faf4a7 to 34e06ec Compare December 16, 2022 22:17
@kshyju
Copy link
Member

kshyju commented Jan 5, 2023

<AssemblyName>Microsoft.Azure.Functions.Worker.Grpc</AssemblyName>
<RootNamespace>Microsoft.Azure.Functions.Worker.Grpc</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MinorProductVersion>7</MinorProductVersion>
Copy link
Member

Choose a reason for hiding this comment

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

Should we bring these changes in a minor version update?

}

public Task<IWorkerClient> StartClientAsync(IMessageProcessor messageProcessor, CancellationToken token)
{
Copy link
Member

Choose a reason for hiding this comment

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

Should we token.ThrowIfCancellationRequested();?

{
// Dispatch and return.
Task.Run(() => ProcessRequestCoreAsync(request));
_ = ProcessRequestCoreAsync(message);
Copy link
Member

Choose a reason for hiding this comment

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

We should also update env reload case (line 116) to return capabilities and worker metadata. Can be a follow up PR I can take care of.

Copy link
Member Author

Choose a reason for hiding this comment

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

Has the host been updated to support that? yes, we should, but either way, I'm inclined to say this should be a separate change

@fabiocav fabiocav marked this pull request as ready for review January 18, 2023 00:57
@fabiocav
Copy link
Member Author

/check-enforcer evaluate

@fabiocav fabiocav merged commit bbc325a into main Jan 19, 2023
@fabiocav fabiocav deleted the fabiocav/nativehostintegration branch January 19, 2023 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants