Skip to content

Hosted AspNetCoreServer with BackgroundService? #1286

Answered by normj
lucasteles asked this question in Q&A
Discussion options

You must be logged in to vote

You technically could but the IHostedService would only run while a request is being processed. As soon as the request is complete the the Lambda compute environment would be frozen and there is no guarantees it would ever be unfrozen. For example Lambda could terminated the Lambda compute environment and spin up a new environment for the next event. So running an IHostedService in a Lambda ASP.NET Core function has limited usefulness.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@lucasteles
Comment options

@lucasteles
Comment options

Answer selected by ashishdhingra
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
guidance Question that needs advice or information. module/aspnetcore-support
3 participants