Table of Contents

Class FlowRepositoryExtensions

Namespace
FlowOrchestrator.Core.Storage
Assembly
FlowOrchestrator.Core.dll

Helper for the dispatch-hot-path "find a flow by id" pattern.

public static class FlowRepositoryExtensions
Inheritance
FlowRepositoryExtensions
Inherited Members

Remarks

Replaces flows.FirstOrDefault(f => f.Id == flowId) at every dispatch call site. The LINQ form allocates a closure capturing flowId on every call; the for-loop form does not. Visible from a Stopwatch on tight dispatch loops because FlowOrchestratorEngine hits this path on every step run and every retry, and HangfireFlowOrchestrator hits it on every dispatched job.

Methods

FindById(IReadOnlyList<IFlowDefinition>, Guid)

Returns the flow with the given flowId by linear scan, or null when not found. Allocation-free.

public static IFlowDefinition? FindById(this IReadOnlyList<IFlowDefinition> flows, Guid flowId)

Parameters

flows IReadOnlyList<IFlowDefinition>
flowId Guid

Returns

IFlowDefinition