Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 3, 2021

Backport of #36122 to release/6.0

/cc @davidfowl

Customer Impact

Customer use hosted services today to run logic before the server starts. This allows them to prewarm various caches or run any logic that has to run before the server starts. In particular this is easy to do if you own main, but when you're a library, hosted services end up being the answer.

Testing

Added a unit test and did manual testing.

Risk

Low. This is a breaking change between rc1 and rc2 but it's preserving the behavior of the hosts that have come before it, in particular, the web host.

davidfowl and others added 2 commits September 3, 2021 04:53
…ric web hosted service is added before any user code runs, as a result its impossible to write a hosted services that run before server startup. This behavior differs from what happens when you use the Startup class today. We call ConfigureServices then we add the IHostedService implementation that starts the server. This change mimics that behavior by adding the initial set of hosted services after your code runs. - Added a test
@davidfowl
Copy link
Member

@dougbu @wtgodbe can you merge?

@wtgodbe wtgodbe merged commit 60ee97b into release/6.0 Sep 3, 2021
@wtgodbe wtgodbe deleted the backport/pr-36122-to-release/6.0 branch September 3, 2021 16:08
@ghost ghost added this to the 6.0-rc2 milestone Sep 3, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants