I assume you are aware of two posts from @ScottHanselmann and @StephenCleary , where you can find mentions of Hangfire and similar libraries. However, these messages are a bit outdated, and they do not provide a solution for .Net Core.
As far as I can see, the proposed fire and swell script method in ASP.NET Core is to use IApplicationLifetime instead of QueueBackgroundWorkItem and IRegisteredObject . You can find a similar question here , and I suggest you carefully study the answers to it.
An example :
The idea (and I'm still not quite sure if it is pretty bad, so be careful!) Is to register a singleton that generates and oversees new tasks. Inside this singleton, we can also register a "stopped event" in order to wait for more running tasks.
source share