Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the PeriodScheduleRequest class
 /// </summary>
 /// <param name="schedulerName">the name of the responsible Scheduler</param>
 /// <param name="targetProcessor">the task processor that will process the request</param>
 /// <param name="task"></param>
 /// <param name="instruction"></param>
 /// <param name="parent"></param>
 /// <param name="lastExecution"></param>
 public PeriodScheduleRequest(string schedulerName, ParallelTaskProcessor targetProcessor, ITask task,
                              PeriodScheduler parent, DateTime?lastExecution = null)
     : base(schedulerName, targetProcessor, task, lastExecution)
 {
     this.parent = parent;
     deferredInstructions.ForEach(AddInstruction);
     deferredInstructions.Clear();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Use this method to initialize the ParallelProcessor unit when your derived class has initialized successfully
        /// </summary>
        private void Ready()
        {
            string workerName = this.UniqueName + "TaskProcessor";

            processor = new ParallelTaskProcessor <TTask>(workerName, GetWorker, highestPriority, lowestPriority, workerCount,
                                                          workerPollInterval, lowTaskThreshold, highTaskThreshold,
                                                          useAffineThreads, useTasks, watchDog);
            factory.RegisterObject(workerName, processor);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Use this method to initialize the ParallelProcessor unit when your derived class has initialized successfully
        /// </summary>
        private void Ready()
        {
            string workerName = $"{this.UniqueName }TaskProcessor";

            processor = new ParallelTaskProcessor <TTask>(workerName, GetWorker, highestPriority, lowestPriority, workerCount,
                                                          workerPollInterval, lowTaskThreshold, highTaskThreshold,
                                                          useAffineThreads, runWithoutSchedulers, useTasks, watchDog);
            processor.GetMoreTasks         += FetchMoreTasks;
            processor.IntegratePendingTask += IntegratePendingTasks;
            factory.RegisterObject(workerName, processor);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the DeferredScheduleRequest class
 /// </summary>
 /// <param name="schedulerName">the name of the responsible Scheduler</param>
 /// <param name="targetProcessor">the target processor</param>
 /// <param name="task">the task to process</param>
 /// <param name="instruction">the instruction for the scheduler</param>
 /// <param name="lastExecution">the last execution date</param>
 public DeferredScheduleRequest(string schedulerName, ParallelTaskProcessor targetProcessor, ITask task, DateTime?lastExecution = null) : base(schedulerName, targetProcessor, task, lastExecution)
 {
 }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a Task request for this TaskScheduler with the Task that needs to be executed and the queue that will execute it
        /// </summary>
        /// <param name="parallelTaskProcessor">the TaskProcessor that will run the provided task later</param>
        /// <param name="task">the task that needs to be executed</param>
        /// <param name="instruction">the default instruction for this schedule request</param>
        /// <returns>a scheduler - request for the given processor and task</returns>
        public override ScheduleRequest CreateRequest(ParallelTaskProcessor parallelTaskProcessor, ITask task)
        {
            PeriodScheduleRequest retVal = new PeriodScheduleRequest(UniqueName, parallelTaskProcessor, task, this, task.LastExecution);

            return(retVal);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Creates a Task request for this TaskScheduler with the Task that needs to be executed and the queue that will execute it
        /// </summary>
        /// <param name="parallelTaskProcessor">the TaskProcessor that will run the provided task later</param>
        /// <param name="task">the task that needs to be executed</param>
        /// <param name="instruction">the main-instruction for this scheduler</param>
        /// <returns>a scheduler - request for the given processor and task</returns>
        public override ScheduleRequest CreateRequest(ParallelTaskProcessor parallelTaskProcessor, ITask task)
        {
            ScheduleRequest retVal = new DeferredScheduleRequest(UniqueName, parallelTaskProcessor, task, DateTime.Now);

            return(retVal);
        }