Table of Contents

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

delay TimeSpan

The delay duration.

name string

Optional name for the operation.

Properties

Name

Gets the name of this operation for identification and logging purposes.

public override string Name { get; }

Property Value

string

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

inputData object

The input data for the operation.

foundry IWorkflowFoundry

The workflow foundry providing context and services.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<object>

The output data from the operation.

FromMilliseconds(int)

Creates a delay operation with the specified duration.

public static DelayOperation FromMilliseconds(int milliseconds)

Parameters

milliseconds int

The 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

minutes int

The 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

seconds int

The delay duration in seconds.

Returns

DelayOperation

A delay operation.