コード例 #1
0
        private bool AttemptCycle(ScheduledJob job)
        {
            job.Attempts++;
            var success = Perform(job);

            if (!success)
            {
                var dueTime = DateTime.Now + Linger.IntervalFunction(job.Attempts);
                job.RunAt = dueTime;
            }
            return(success);
        }
コード例 #2
0
 public static void PerformAsync(this Perform perform, int?priority = null)
 {
     Linger.QueueForExecution(perform, priority ?? Linger.DefaultPriority);
 }
コード例 #3
0
        public static void PerformAsync(this Action job, DateTime runAt, int?priority = null)
        {
            var inner = new DelegateJob(() => { job(); return(true); });

            Linger.QueueForExecution(inner, priority ?? Linger.DefaultPriority, runAt);
        }
コード例 #4
0
 public static void PerformAsync(this Func <bool> job, DateTime runAt, int?priority = null)
 {
     Linger.QueueForExecution(new DelegateJob(job), priority ?? Linger.DefaultPriority, runAt);
 }