Azure / Azure/azure-functions-host

Small refactor to HostBuiltChangeTokenSource

Open
#11,208 0 comments 0 reactions 0 assignees View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

If you look at this code, it's hardcoded to explicitly signal for the one specific tokensource class:

https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs#L381-L384

We have the need to add a second class that we want to react to this -- and rather than add another `if` statement and directly signal the affected classes, we should share a token across them that we can signal here and trigger them all simultaneously. Similar to what we do with StandbyOptions where triggering the StandbyToken can propagate to all affected other options that need re-built.

Contributor guide

Open the contributing guide

Research direction

Start in src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs around lines 381-384 and inspect HostBuiltChangeTokenSource and the StandbyOptions/StandbyToken pattern. Trace the affected token-source classes, then confirm that one shared token can be signaled there so all affected classes rebuild simultaneously without another class-specific condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.