Пример #1
0
            public CurrentRunningJob(DECronEngine parent, ICronJobExecute job, CancellationToken cancellationToken)
            {
                this.parent    = parent ?? throw new ArgumentNullException(nameof(parent));
                this.job       = job ?? throw new ArgumentNullException(nameof(job));
                this.jobCancel = job as ICronJobCancellation;

                this.cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
                this.task = Task.Factory.StartNew(Execute, cancellationTokenSource.Token);
                this.task.ContinueWith(EndExecute);

                // automatic cancel
                if (jobCancel != null && jobCancel.RunTimeSlice.HasValue)
                {
                    cancellationTokenSource.CancelAfter(jobCancel.RunTimeSlice.Value);
                }
            }             // ctor
Пример #2
0
 public CronItemCacheController(DECronEngine owner)
 {
     this.owner = owner ?? throw new ArgumentNullException(nameof(owner));
     owner.RegisterList(Id, this, true);
 }             // ctor
Пример #3
0
 public CronItemCacheController(DECronEngine owner)
 {
     this.owner = owner;
     owner.RegisterList(Id, this, true);
 }             // ctor