Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/Checkpointing/ExecutorInfo.cs
T
Jacob AlberandGitHub b25b0af49b .NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs (#1637)
* refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding

* Switch to more modern Record type-tree for Sum Types
* Unify APIs for getting ExecutorBinding
* Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.

* feat: Simplify function-to-executor pattern

* refactor: Normalize API naming
2025-11-03 18:20:35 +00:00

19 lines
638 B
C#

// Copyright (c) Microsoft. All rights reserved.
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
internal sealed record class ExecutorInfo(TypeId ExecutorType, string ExecutorId)
{
public bool IsMatch<T>() where T : Executor =>
this.ExecutorType.IsMatch<T>()
&& this.ExecutorId == typeof(T).Name;
public bool IsMatch(Executor executor) =>
this.ExecutorType.IsMatch(executor.GetType())
&& this.ExecutorId == executor.Id;
public bool IsMatch(ExecutorBinding binding) =>
this.ExecutorType.IsMatch(binding.ExecutorType)
&& this.ExecutorId == binding.Id;
}