示例#1
0
 internal JobWorker(JobWorkerBuilder builder)
 {
     this.jobWorkerBuilder = builder;
     this.source           = new CancellationTokenSource();
     this.logger           = builder.LoggerFactory?.CreateLogger <JobWorker>();
     this.jobHandler       = jobWorkerBuilder.Handler();
     this.autoCompletion   = builder.AutoCompletionEnabled();
     this.pollInterval     = jobWorkerBuilder.PollInterval();
 }
示例#2
0
 internal JobWorker(JobWorkerBuilder builder)
 {
     source         = new CancellationTokenSource();
     activator      = new JobActivator(builder.Client);
     activeRequest  = builder.Request;
     maxJobsActive  = activeRequest.MaxJobsToActivate;
     pollInterval   = builder.PollInterval();
     jobClient      = new JobClientWrapper(builder.JobClient);
     jobHandler     = builder.Handler();
     autoCompletion = builder.AutoCompletionEnabled();
 }
示例#3
0
 internal JobWorker(JobWorkerBuilder builder)
 {
     this.jobWorkerBuilder        = builder;
     this.source                  = new CancellationTokenSource();
     this.logger                  = builder.LoggerFactory?.CreateLogger <JobWorker>();
     this.jobHandler              = jobWorkerBuilder.Handler();
     this.autoCompletion          = builder.AutoCompletionEnabled();
     this.pollInterval            = jobWorkerBuilder.PollInterval();
     this.activateJobsCommand     = jobWorkerBuilder.Command;
     this.maxJobsActive           = jobWorkerBuilder.Command.Request.MaxJobsToActivate;
     this.thresholdJobsActivation = maxJobsActive * 0.6;
 }