public static JobsOptions UseSqlServer(this JobsOptions options, string connectionString)
 {
     return(options.UseSqlServer(opts =>
     {
         opts.ConnectionString = connectionString;
     }));
 }
Beispiel #2
0
 public BootstrapperBase(
     JobsOptions options,
     IStorage storage,
     IProcessingServer server)
 {
     Options = options;
     Storage = storage;
     Server  = server;
 }
Beispiel #3
0
 public SqlServerBootstrapper(
     JobsOptions options,
     IStorage storage,
     IProcessingServer server,
     IApplicationLifetime appLifetime)
     : base(options, storage, server)
 {
     _appLifetime = appLifetime;
 }
Beispiel #4
0
 public JobsManager(
     JobsOptions options,
     IStorage storage,
     IProcessingServer server)
 {
     _options = options;
     _storage = storage;
     _server  = server;
 }
        public static JobsOptions UseSqlServer(this JobsOptions options, Action <SqlServerOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new SqlServerJobsOptionsExtension(configure));

            return(options);
        }
Beispiel #6
0
        public static void AddJobs(
            this IServiceCollection services,
            Action <JobsOptions> configure)
        {
            services.AddSingleton <IJobsManager, JobsManager>();
            services.AddSingleton <IJobFactory, JobFactory>();
            services.AddSingleton <IProcessingServer, ProcessingServer>();

            // Processors
            services.AddTransient <FireAndForgetJobProcessor>();
            services.AddTransient <DelayedJobProcessor>();
            services.AddTransient <CronJobProcessor>();

            var options = new JobsOptions();

            configure(options);
            options.Extension?.AddServices(services);
            services.AddSingleton(options);
        }