使用Fire和忘记API封装Hangfire创建方法

时间:2017-03-17 15:17:21

标签: hangfire

直到Hangfire支持async / await,将作业创建方法的调用封装在火中并忘记HostingEnvironment.QueueBackgroundWorkItemStephenCleary/AspNetBackgroundTasks等API是个好主意吗?

的示例:

HostingEnvironment.QueueBackgroundWorkItem((cancelationToken) => BackgroundJob.Enqueue(() => SomeClass.DoWork()));

BackgroundTaskManager.Run(() =>
{
  BackgroundJob.Enqueue(() => SomeClass.DoWork());
});

0 个答案:

没有答案