DalSoft.Hosting.BackgroundQueue icon indicating copy to clipboard operation
DalSoft.Hosting.BackgroundQueue copied to clipboard

Add support for IServiceProvider in exception handling

Open nh43de opened this issue 7 years ago • 1 comments

  • 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.");
    });

nh43de avatar Jul 22 '18 21:07 nh43de

Like it thanks for taking the time to create a PR. I'll pull it in and push it up to nuget shortly

DalSoft avatar Jul 24 '18 21:07 DalSoft

This is implemented in v2.0

DalSoft avatar Sep 06 '24 07:09 DalSoft