DalSoft.Hosting.BackgroundQueue
DalSoft.Hosting.BackgroundQueue copied to clipboard
Add support for IServiceProvider in exception handling
-
added another extension method to support passing of IServiceProvider when handling exceptions
-
added IServiceProvider parameter to the BackgroundQueue class to support new extension method
Now user can access services when handling exceptions, like this
services.AddBackgroundQueue(maxConcurrentCount: 1, millisecondsToWaitBeforePickingUpTask: 1000,
onException: (_, exception) =>
{
_.GetService<YourLogger>().LogError(exception, "There was an error in the background queue.");
});
Like it thanks for taking the time to create a PR. I'll pull it in and push it up to nuget shortly
This is implemented in v2.0