Beispiel #1
0
 public CronJob(string schedule, Action action)
 {
     _cron_schedule           = new CronSchedule(schedule);
     _action                  = action;
     _cancellationTokenSource = new CancellationTokenSource();
     _task = new Task(action, _cancellationTokenSource.Token, TaskCreationOptions.LongRunning);
 }
Beispiel #2
0
 public CronJob(string schedule, ThreadStart thread_start)
 {
     _cron_schedule = new CronSchedule(schedule);
     this.Schedule = schedule;
     _thread_start = thread_start;
     _thread = new Thread(thread_start);
 }
Beispiel #3
0
 public CronJob(string schedule, ParameterizedThreadStart thread_start, object arg)
 {
     _cron_schedule = new CronSchedule(schedule);
     _thread_start  = thread_start;
     _thread        = new Thread(thread_start);
     _arg           = arg;
 }
Beispiel #4
0
 public CronJob(string schedule, Action action)
 {
     _cron_schedule    = new CronSchedule(schedule);
     _action           = action;
     cancellationToken = new CancellationTokenSource();
     //_thread = new Thread(thread_start);
 }
Beispiel #5
0
        public CronJob(string schedule, Action jobAction, string timeZoneId, CronJobRunMode runMode = CronJobRunMode.RunInParallel, int jobTaskQueueUpperLimit = 5)
        {
            this.runMode = runMode;
            this.jobTaskQueueUpperLimit = jobTaskQueueUpperLimit;
            activeJobTaskQueue          = new List <Task>();
            cancelToken = new CancellationTokenSource();

            _cron_schedule = new CronSchedule(schedule);
            _job_action    = jobAction;

            if (!string.IsNullOrEmpty(timeZoneId))
            {
                timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
            }
        }
Beispiel #6
0
 public CronJob(string schedule, JobModel job)
 {
     _cronSchedule = new CronSchedule(schedule);
     _job = job;
 }
Beispiel #7
0
 public CronJob(string schedule, JobModel job)
 {
     _cronSchedule = new CronSchedule(schedule);
     _job          = job;
 }
 public CronJob(string schedule, CronAction action)
 {
     this.cronSchedule = new CronSchedule(schedule);
     this.cronAction   = action;
     thread            = new Thread(cronAction.Action);
 }
Beispiel #9
0
 public CronJob(string schedule, ThreadStart threadStart)
 {
     cronSchelude   = new CronSchedule(schedule);
     ThreadFunction = threadStart;
     OwnThread      = new Thread(ThreadFunction);
 }
Beispiel #10
0
 public CronJob(string schedule, ThreadStart thread_start)
 {
     _cron_schedule = new CronSchedule(schedule);
     _thread_start  = thread_start;
     _thread        = new Thread(thread_start);
 }