Ejemplo n.º 1
0
 public TaskSchedule(
     TaskInfo taskInfo,
     string crontab,
     ITaskQueueBackend backend, string taskKey) : this(taskInfo, backend, true, taskKey)
 {
     ValidateCrontab(crontab);
     _crontab = crontab;
 }
Ejemplo n.º 2
0
 public TaskSchedule(
     TaskInfo taskInfo,
     DateTime scheduledTime,
     ITaskQueueBackend backend,
     bool isRecurring, string taskId) : this(taskInfo, backend, isRecurring, taskId)
 {
     _scheduledTime = scheduledTime;
 }
Ejemplo n.º 3
0
 public TaskSchedule(
     TaskInfo taskInfo,
     DateTimeOffset scheduledTimeAsDateTimeOffset,
     ITaskQueueBackend backend,
     bool isRecurring, string taskId) : this(taskInfo, backend, isRecurring, taskId)
 {
     _scheduledTimeAsDateTimeOffset = scheduledTimeAsDateTimeOffset;
 }
Ejemplo n.º 4
0
 public TaskSchedule(
     TaskInfo taskInfo,
     TimeSpan interval,
     ITaskQueueBackend backend,
     bool isRecurring, string taskId) : this(taskInfo, backend, isRecurring, taskId)
 {
     _intervalOrOffsetFromNow = interval;
 }
Ejemplo n.º 5
0
        private TaskSchedule(TaskInfo taskInfo, ITaskQueueBackend backend, bool isRecurring, string taskKey)
        {
            _backend   = backend;
            _taskInfo  = taskInfo;
            _startTime = DateTime.UtcNow;

            TaskKey     = taskKey;
            IsRecurring = isRecurring;
        }
Ejemplo n.º 6
0
 public TaskSchedule(
     TaskInfo taskInfo,
     TimeSpan interval,
     ITaskQueueBackend backend)
 {
     _backend  = backend;
     TaskInfo  = taskInfo;
     Interval  = interval;
     StartTime = DateTime.Now;
 }
Ejemplo n.º 7
0
        public TaskQueue(ITaskQueueBackend backend, TaskQueueConfiguration config = null)
        {
            Backend = backend;
            Config  = config ?? new TaskQueueConfiguration();

            // Usage of the Task Queue in Parallel Threads, requires the thread pool size to be increased.
            // https://stackexchange.github.io/StackExchange.Redis/Timeouts#are-you-seeing-high-number-of-busyio-or-busyworker-threads-in-the-timeout-exception
            if (config.ThreadSafe)
            {
                ThreadPool.SetMinThreads(200, 200);
            }
        }
Ejemplo n.º 8
0
        public TaskQueue(ITaskQueueBackend backend, TaskQueueConfiguration config = null)
        {
            Backend = backend;
            Config  = config ?? TaskQueueConfiguration.Default();

            // Usage of the Task Queue in Parallel Threads, requires the thread pool size to be increased.
            // https://stackexchange.github.io/StackExchange.Redis/Timeouts#are-you-seeing-high-number-of-busyio-or-busyworker-threads-in-the-timeout-exception
            // REVIEW: This should no longer be necessary now that we are using the redis async api.
            if (Config.ThreadSafe)
            {
                ThreadPool.SetMinThreads(200, 200);
            }
        }