public async static Task <ApplicationInitializationContext> AddBackgroundWorkerAsync <TWorker>([NotNull] this ApplicationInitializationContext context, CancellationToken cancellationToken = default) where TWorker : IBackgroundWorker { Check.NotNull(context, nameof(context)); await context.AddBackgroundWorkerAsync(typeof(TWorker), cancellationToken : cancellationToken); return(context); }
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { var options = context.ServiceProvider.GetRequiredService <IOptions <AbpBackgroundJobOptions> >().Value; if (options.IsJobExecutionEnabled) { await context.AddBackgroundWorkerAsync <IBackgroundJobWorker>(); } }
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { await context.AddBackgroundWorkerAsync <OutboxSenderManager>(); await context.AddBackgroundWorkerAsync <InboxProcessManager>(); }