// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.AI.Agents.Runtime;
///
/// Interface for actor state storage operations, providing persistence for actor state data.
///
public interface IActorStateStorage
{
///
/// Writes state changes to the actor's persistent storage.
///
/// The identifier of the actor whose state is being modified.
/// The collection of write operations to perform.
/// The expected ETag for optimistic concurrency control.
/// A token to cancel the operation.
/// A task representing the write response with success status and updated ETag.
ValueTask WriteStateAsync(ActorId actorId, IReadOnlyCollection operations, string etag, CancellationToken cancellationToken = default);
///
/// Reads state data from the actor's persistent storage.
///
/// The identifier of the actor whose state is being read.
/// The collection of read operations to perform.
/// A token to cancel the operation.
/// A task representing the read response with results and current ETag.
ValueTask ReadStateAsync(ActorId actorId, IReadOnlyCollection operations, CancellationToken cancellationToken = default);
}