Files
agent-framework/dotnet/src/Microsoft.Agents.Workflows/FanOutEdgeData.cs
T
Jacob Alber 2015f0dc09 .NET: [BREAKING] Support Checkpoint Serialization (#735)
* feat: Support Checkpoint Serialization

* Implements serialization roundtripping for checkpoints.
* Adds support for JSON serialization
* Adds FileSystem-based checkpoint persistence

* fix: Executor State does not deserialize correctly

The StateManager was not properly handling delay-deserialized values.

* Fix PortableValue handling in StateManager (this makes it delegate to PortableValue the uwnrapping)
* Fix UnitTest to actually test checkpoint serialization
* Additional review comment fixes

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
2025-09-17 19:57:19 +00:00

43 lines
1.4 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using Microsoft.Agents.Workflows.Execution;
using AssignerF = System.Func<object?, int, System.Collections.Generic.IEnumerable<int>>;
namespace Microsoft.Agents.Workflows;
/// <summary>
/// Represents a connection from a single node to a set of nodes, optionally associated with a paritition selector
/// function which maps incoming messages to a subset of the target set.
/// </summary>
internal sealed class FanOutEdgeData : EdgeData
{
internal FanOutEdgeData(string sourceId, List<string> sinkIds, EdgeId edgeId, AssignerF? assigner = null) : base(edgeId)
{
this.SourceId = sourceId;
this.SinkIds = sinkIds;
this.EdgeAssigner = assigner;
this.Connection = new([sourceId], sinkIds);
}
/// <summary>
/// The Id of the source <see cref="Executor"/> node.
/// </summary>
public string SourceId { get; }
/// <summary>
/// The ordered list of Ids of the destination <see cref="Executor"/> nodes.
/// </summary>
public List<string> SinkIds { get; }
/// <summary>
/// A function mapping an incoming message to a subset of the target executor nodes (or optionally all of them).
/// If <see langword="null"/>, all destination nodes are selected.
/// </summary>
public AssignerF? EdgeAssigner { get; }
/// <inheritdoc />
internal override EdgeConnection Connection { get; }
}