コード例 #1
0
ファイル: CronEngine.cs プロジェクト: InfFelixNaumann/des
            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
ファイル: CronEngine.cs プロジェクト: InfFelixNaumann/des
 public CronItemCacheController(DECronEngine owner)
 {
     this.owner = owner ?? throw new ArgumentNullException(nameof(owner));
     owner.RegisterList(Id, this, true);
 }             // ctor
コード例 #3
0
ファイル: CronEngine.cs プロジェクト: s72785/des
 public CronItemCacheController(DECronEngine owner)
 {
     this.owner = owner;
     owner.RegisterList(Id, this, true);
 }             // ctor