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);
    }
示例#2
0
    public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
    {
        var options = context.ServiceProvider.GetRequiredService <IOptions <AbpBackgroundJobOptions> >().Value;

        if (options.IsJobExecutionEnabled)
        {
            await context.AddBackgroundWorkerAsync <IBackgroundJobWorker>();
        }
    }
示例#3
0
    public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
    {
        await context.AddBackgroundWorkerAsync <OutboxSenderManager>();

        await context.AddBackgroundWorkerAsync <InboxProcessManager>();
    }