skip to Main Content

Should I use async with the ASP.NET QueueBackgroundWorkItem method for an async method?

When using QueueBackgroundWorkItem, is there any difference in the below two ways of calling a method that performs async operations like api calls? HostingEnvironment.QueueBackgroundWorkItem(async cancellationToken => { var result = await LongRunningMethodAsync(); }); Or the following: HostingEnvironment.QueueBackgroundWorkItem(cancellationToken => LongRunningMethodAsync()); I'm…

VIEW QUESTION
Back To Top
Search