Class BulkTaskResult<TResult>
OptimaJet.Workflow.Core.Runtime.Bulk.BulkTaskResult<TResult>
Represents the result of a bulk task execution. For tasks that have not finished, BulkTaskResult<TResult>.Empty is used.
Namespace: OptimaJet.Workflow.Core.Runtime.Bulk
public record BulkTaskResult<TResult> : IEquatable<BulkTaskResult<TResult>>Type Hierarchy
- BulkTaskResult<TResult> Current type
- Implemented interfaces
Constructors
public BulkTaskResult(BulkTaskState State, TResult? Result = default, Exception? Exception = null, DateTimeOffset? StartedAt = null, DateTimeOffset? FinalizedAt = null) #Represents the result of a bulk task execution. For tasks that have not finished, BulkTaskResult<TResult>.Empty is used.
Parameters
Name
Type
Description
StateBulkTaskStateThe state of the task.
Result{TResult}If the task has completed with the status BulkTaskState.Completed, the result will be stored here; otherwise, it will be null.
ExceptionExceptionIf the task has completed with the status BulkTaskState.Failed, the exception will be stored here; otherwise, it will be null.
StartedAtNullable<DateTimeOffset>The timestamp recorded when the task transitions to BulkTaskState.Running and before task execution starts.
FinalizedAtNullable<DateTimeOffset>The timestamp recorded after transitioning to BulkTaskState.Completed or BulkTaskState.Failed, before the task result is returned.
Properties
public BulkTaskState State { get; init; } #The state of the task.
public TResult? Result { get; init; } #If the task has completed with the status BulkTaskState.Completed, the result will be stored here; otherwise, it will be null.
public Exception? Exception { get; init; } #If the task has completed with the status BulkTaskState.Failed, the exception will be stored here; otherwise, it will be null.
public DateTimeOffset? StartedAt { get; init; } #The timestamp recorded when the task transitions to BulkTaskState.Running and before task execution starts.
public DateTimeOffset? FinalizedAt { get; init; } #The timestamp recorded after transitioning to BulkTaskState.Completed or BulkTaskState.Failed, before the task result is returned.
public static BulkTaskResult<TResult> Empty { get; } #Gets a canonical result value for a task that has not yet started.
public TimeSpan? Duration { get; } #Gets the elapsed time between task start and finalization.