Assembly: OptimaJet.Workflow.Core

Class WorkflowTimerProcessor

OptimaJet.Workflow.Core.Runtime.Timers.WorkflowTimerProcessor

Provides timer processing for workflow runtime instances.

public class WorkflowTimerProcessor

Constructors

public WorkflowTimerProcessor(WorkflowRuntime workflowRuntime, CancellationToken token) #
Initializes a new instance of the WorkflowTimerProcessor class.

Parameters

Name
Type
Description
workflowRuntime
WorkflowRuntime
Workflow runtime used to execute timer actions and update process state.
token
CancellationToken
Cancellation token observed while processing timers.

Methods

public Func<Task> GetTimerProcessorAsyncAction(IGrouping<Guid, WorkflowTimer> timersGroup) #
Creates an asynchronous delegate that processes all timers in the specified group.

Parameters

Name
Type
Description
timersGroup
IGrouping<Guid, WorkflowTimer>
A collection of workflow timers grouped by root process identifier.

Returns

Type
Description
Func<Task>
A delegate that can be executed to process all timers in timersGroup sequentially.

Remarks

The returned action orders timers by WorkflowTimer.NextExecutionDateTime, locks each timer before execution, executes it through the runtime timer execution flow, and then removes the timer or resets process state as needed.