コード例 #1
0
 public ScheduledTaskExecution(string storedProcedureName, int scheduledTaskid, IThreadSafeDataAccess threadSafeDataAccess, ExitStrategy exitStrategy)
 {
     _scheduledTaskid = scheduledTaskid;
     _storedProcedureName = storedProcedureName;
     _threadSafeDataAccess = threadSafeDataAccess;
     _exitStrategy = exitStrategy;
 }
コード例 #2
0
 public ScheduledTaskExecution(IScheduledTask scheduledTask, int scheduledTaskId, IThreadSafeDataAccess threadSafeDataAccess, ExitStrategy exitStrategy)
 {
     _scheduledTaskid = scheduledTaskId;
     _cSharpScheduledTask = scheduledTask;
     _threadSafeDataAccess = threadSafeDataAccess;
     _exitStrategy = exitStrategy;
 }
コード例 #3
0
 public static ScheduledTaskMonitorContext GenerateFakeScheduledTaskContextWithFailingTasks(ExitStrategy exitStrategy)
 {
     return new ScheduledTaskMonitorContext(sleepIntervalTimeInSeconds: 0,
                                            scheduledTaskTypes: ScheduledTaskObjectMother.GenerateFakeFailingTaskTypes(),
                                            loggingCategory: LogCategories.FailingScheduledTaskMonitor,
                                            exitStrategy: exitStrategy,
                                            threadSafeDataAccess: new FailingWorkflowThreadSafeDataAccess(),
                                            onEngineRevolutionCallBack: () => { exitStrategy.Quitting = true; });
 }
コード例 #4
0
ファイル: WorkflowTests.cs プロジェクト: Exclr8/CloudCore
        public void FailedWorkflowEngine_WorkflowMonitorLoop_WorkItemRetryWhenMaxRetriesNotReached()
        {
            var exitStrategy = new ExitStrategy();
            var context = WorkflowContextObjectMother.GenerateWorkflowContextWithFailingActivities(exitStrategy);
            var worklistItem = WorkListObjectMother.GenerateFakeWorklistItem(context.ActivityTypes, maxRetries: 3);
            var mockFailedWorkflow = new MockFailedWorkflowEngine(context, worklistItem);

            mockFailedWorkflow.WorkflowMonitorLoop();

            Assert.AreEqual(WorkItemStatus.Retry.Id, mockFailedWorkflow.StatusResult.Id);
        }
コード例 #5
0
 public static WorkflowContext GenerateWorkflowContextWithFailingActivities(ExitStrategy exitStrategy)
 {
     return new WorkflowContext(sleepIntervalTimeInSeconds: 0,
                                locationConfig: null,
                                activityTypes: ActivityObjectMother.GenerateFakeFailingActivities(),
                                loggingCategory: LogCategories.FailingWorkflowEngine,
                                threadSafeDataAccess: new FailingWorkflowThreadSafeDataAccess(),
                                exitStrategy: exitStrategy,
                                onEngineRevolutionCallBack: () => { exitStrategy.Quitting = true; },
                                parallelThreadCount:-1);
 }
コード例 #6
0
        public void ScheduledTaskFailWhenMaxRetriesReached()
        {
            var exitStrategy = new ExitStrategy();
            var context = ScheduledTaskContextObjectMother.GenerateFakeScheduledTaskContextWithFailingTasks(exitStrategy);
            var fakeScheduledTask = ScheduledTaskObjectMother.GenerateFakeScheduledTask(3, 3);
            var mockedFailedScheduledEngine = new MockedFailedScheduledTaskEngine(context);

            mockedFailedScheduledEngine.ExecuteScheduledTask(fakeScheduledTask);

            Assert.AreEqual(ScheduledTaskStatusId.Failed, mockedFailedScheduledEngine.StatusResult);
        }
コード例 #7
0
        public WorkerOperationContext(int sleepIntervalTimeInSeconds, string loggingCategory, IThreadSafeDataAccess threadSafeDataAccess, ExitStrategy exitStrategy, Action onEngineRevolutionCallBack = null)
#endif
        {
            SleepIntervalTimeInSeconds = sleepIntervalTimeInSeconds;
            LoggingCategory = loggingCategory;
            EngineRevolutionCallBack = onEngineRevolutionCallBack;
            ThreadSafeDataAccess = threadSafeDataAccess;
            this.ExitStrategy = exitStrategy;
#if DEBUG
            EngineRevolutionUnsafeCallback = onEngineRevolutionUnsafeCallBack;
#endif
        }
コード例 #8
0
ファイル: WorkflowContext.cs プロジェクト: Exclr8/CloudCore
        public WorkflowContext(int sleepIntervalTimeInSeconds, 
                               ILocationConfig locationConfig, 
                               Dictionary<string, Type> activityTypes,
                               string loggingCategory,
                               IThreadSafeDataAccess threadSafeDataAccess,
                               ExitStrategy exitStrategy,
                               Action onEngineRevolutionCallBack = null,
                               int parallelThreadCount = -1)

            : base(sleepIntervalTimeInSeconds, loggingCategory, threadSafeDataAccess, exitStrategy, onEngineRevolutionCallBack)
        {
            LocationConfig = locationConfig;
            ActivityTypes = activityTypes;
            ParallelThreadCount = parallelThreadCount;
        }
コード例 #9
0
ファイル: WorkflowTests.cs プロジェクト: Exclr8/CloudCore
        public void NormalWorkflowEngine_WorkflowMonitorLoop_WhenFailingWithMaxRetriesGreaterThanZero_WorkflowItemRetry()
        {
            var exitStrategy = new ExitStrategy();
            var context = WorkflowContextObjectMother.GenerateWorkflowContextWithFailingActivities(exitStrategy);
            var worklistItem = WorkListObjectMother.GenerateFakeWorklistItem(context.ActivityTypes, maxRetries: 3, currentRetries: 0);
            var mockFailedWorkflow = new MockNormalWorkflowEngine(context, worklistItem);

            mockFailedWorkflow.WorkflowMonitorLoop();

            Assert.AreEqual(WorkItemStatus.Retry.Id, mockFailedWorkflow.StatusResult.Id);
        }
コード例 #10
0
ファイル: EngineLoopLimiter.cs プロジェクト: Exclr8/CloudCore
 public static EngineLoopLimiter New(ExitStrategy exitStrategy)
 {
     return new EngineLoopLimiter(exitStrategy);
 }
コード例 #11
0
ファイル: EngineLoopLimiter.cs プロジェクト: Exclr8/CloudCore
 public EngineLoopLimiter(ExitStrategy exitStrategy)
 {
     this.exitStrategy = exitStrategy;
 }
コード例 #12
0
 public ScheduledTaskMonitorContext(int sleepIntervalTimeInSeconds, Dictionary<string, Type> scheduledTaskTypes, string loggingCategory, 
                                    IThreadSafeDataAccess threadSafeDataAccess, ExitStrategy exitStrategy, Action onEngineRevolutionCallBack = null)
     : base(sleepIntervalTimeInSeconds, loggingCategory, threadSafeDataAccess, exitStrategy, onEngineRevolutionCallBack)
 {
     ScheduledTaskTypes = scheduledTaskTypes;
 }
コード例 #13
0
 public DashboardTaskOperationContext(int sleepIntervalTimeInSeconds, string loggingCategory, IThreadSafeDataAccess threadSafeDataAccess,
     ExitStrategy exitStrategy, Dictionary<string, Type> dashboardTaskClassTypes, Action onEngineRevolutionCallBack = null, Action onEngineRevolutionUnsafeCallBack = null) 
     : base(sleepIntervalTimeInSeconds, loggingCategory, threadSafeDataAccess, exitStrategy, onEngineRevolutionCallBack)
 {
     DashboardTaskClassTypes = dashboardTaskClassTypes;
 }
コード例 #14
0
 public WorkerOperationContext(int sleepIntervalTimeInSeconds, string loggingCategory, IThreadSafeDataAccess threadSafeDataAccess, ExitStrategy exitStrategy, Action onEngineRevolutionCallBack = null, Action onEngineRevolutionUnsafeCallBack = null)
コード例 #15
0
ファイル: Worker.cs プロジェクト: Exclr8/CloudCore
 protected Worker()
 {
     exitStrategy = new ExitStrategy();
     InitializeMainWorkerSettings();
 }