Files
agent-framework/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/ExecutionExtensions.cs
Jacob Alber 331c750515 .NET: [BREAKING] Enable sharing of workflow instances across concurrently executing runs (#1464)
* refactor: remove unused internals

* feat: Execution Mode for sharing a workflow among concurrent runs

* feat: Update WorkflowHostAgent to support concurrent execution

* Also update AsAgent APIs to support injecting a CheckpointManager and an IWorkflowExecutionEnvironment

* fix: Make Read logic consistent in DeclarativeWorkflowContext
2025-10-15 21:34:17 +00:00

21 lines
711 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
namespace Microsoft.Agents.AI.Workflows.UnitTests;
internal static class ExecutionExtensions
{
public static IWorkflowExecutionEnvironment ToWorkflowExecutionEnvironment(this ExecutionEnvironment environment)
{
return environment switch
{
ExecutionEnvironment.InProcess_OffThread => InProcessExecution.OffThread,
ExecutionEnvironment.InProcess_Lockstep => InProcessExecution.Lockstep,
ExecutionEnvironment.InProcess_Concurrent => InProcessExecution.Concurrent,
_ => throw new InvalidOperationException($"Unknown execution environment {environment}")
};
}
}