Class DelayOperation
- Namespace
- WorkflowForge.Operations
- Assembly
- WorkflowForge.dll
Simple delay operation for workflow pacing and testing. Useful for introducing controlled delays in workflow execution.
public sealed class DelayOperation : WorkflowOperationBase, IWorkflowOperation, IDisposable
- Inheritance
-
DelayOperation
- Implements
- Inherited Members
- Extension Methods
Constructors
DelayOperation(TimeSpan, string?)
Initializes a new delay operation.
public DelayOperation(TimeSpan delay, string? name = null)
Parameters
Properties
Name
Gets the name of this operation for identification and logging purposes.
public override string Name { get; }
Property Value
Methods
ForgeAsyncCore(object?, IWorkflowFoundry, CancellationToken)
Core operation logic. Implement this method with your operation's business logic. This is called between OnBeforeExecuteAsync and OnAfterExecuteAsync.
protected override Task<object?> ForgeAsyncCore(object? inputData, IWorkflowFoundry foundry, CancellationToken cancellationToken = default)
Parameters
inputDataobjectThe input data for the operation.
foundryIWorkflowFoundryThe workflow foundry providing context and services.
cancellationTokenCancellationTokenThe cancellation token.
Returns
FromMilliseconds(int)
Creates a delay operation with the specified duration.
public static DelayOperation FromMilliseconds(int milliseconds)
Parameters
millisecondsintThe delay duration in milliseconds.
Returns
- DelayOperation
A delay operation.
FromMinutes(int)
Creates a delay operation with the specified duration.
public static DelayOperation FromMinutes(int minutes)
Parameters
minutesintThe delay duration in minutes.
Returns
- DelayOperation
A delay operation.
FromSeconds(int)
Creates a delay operation with the specified duration.
public static DelayOperation FromSeconds(int seconds)
Parameters
secondsintThe delay duration in seconds.
Returns
- DelayOperation
A delay operation.