-
Notifications
You must be signed in to change notification settings - Fork 471
Decoupling worker behavior #11479
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
Decoupling worker behavior #11479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors worker-related functionality by relocating it from WebJobs.Script to WebJobs.Script.Grpc and making these classes internal to prevent accidental reuse in core host code. New abstractions are introduced where needed to decouple dependencies. The changes are primarily structural and should not affect current functionality.
- Moved worker process management and HTTP worker behavior to
Script.Grpcproject - Changed worker classes to
internalvisibility - Introduced new abstractions like
IWebHostWorkerManager,IScriptHostWorkerManager,IWorkerFunctionDescriptorProviderFactory, andIScriptHostLifecycleService - Registered all behavior via DI through new extension methods
Reviewed Changes
Copilot reviewed 110 out of 140 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Various test files (TestRpc*, HttpWorkerTestUtilities, etc.) | Changed test utility classes from public to internal to match new visibility patterns |
| DefaultWorkerProcessFactoryTests.cs | Test methods changed from public to internal |
| FunctionMetadataManager.cs | Removed HttpWorkerOptions dependency, replaced with FunctionMetadataOptions |
| ScriptHost.cs | Removed direct FunctionInvocationDispatcher dependencies, replaced with abstraction interfaces |
| WebScriptHostExceptionHandler.cs | Replaced IFunctionInvocationDispatcherFactory with IScriptHostWorkerManager |
| HostController.cs | Replaced direct channel manager access with IScriptHostWorkerManager |
| Various Grpc project files | Moved and made internal: worker processes, channels, factories, and descriptors |
| RpcServiceCollectionExtensions.cs | New DI registration extension methods for RPC services |
| ScriptHostRecycleOptionsSetup.cs | Split into two classes to decouple HTTP worker logic |
We have a major refactor of worker behavior planned, but in order to execute on that plan, we need to have a better decoupling of the current worker pipeline.
In order to facilitate that, this PR:
Script.Grpcprojectinternalso that they are not accidentally used again in the core host codeNote that these new abstractions are not perfect and will likely go through further refinement. But we want to get this large change in first and then iterate as we go forward.
This change should not be changing how anything works today.
in-procbranch is not requiredrelease_notes.md