Go to content

Concurrent Hosted Service in .NET 8 | .NET Conf 2023

Before .NET 8, hosted services were started and stopped sequentially, with each service's StartAsync and StopAsync methods awaiting completion before the next service's methods were triggered. This default behavior, though mostly fine, could cause problems, particularly with slow services delaying the application's overall start or shutdown. In .NET 8, developers now have the option to enable concurrent start and/or stop behavior for registered hosted services using the new properties in HostOptions. This allows services to start and stop concurrently, potentially improving application startup and shutdown times. Blog: https://aka.ms/dotnet/blog Twitter: https://aka.ms/dotnet/twitter TikTok: https://aka.ms/dotnet/tiktok Mastodon: https://aka.ms/dotnet/mastodon LinkedIn: https://aka.ms/dotnet/linkedin Facebook: https://aka.ms/dotnet/facebook Docs: https://learn.microsoft.com/dotnet Forums: https://aka.ms/dotnet/forums 🙋‍♀️Q&A: https://aka.ms/dotnet-qa 👨‍🎓Microsoft Learn: https://aka.ms/learndotnet #dotnet

November 14, 2023