using Akka.Actor;

namespace ScadaLink.Communication.Grpc;

/// <summary>
/// Abstraction over the site-side stream subscription mechanism.
/// SiteStreamManager in the SiteRuntime project implements this interface;
/// the gRPC server depends on it without referencing SiteRuntime directly.
/// </summary>
public interface ISiteStreamSubscriber
{
    /// <summary>
    /// Subscribes an actor to receive filtered stream events for a specific instance.
    /// </summary>
    /// <returns>A subscription ID that can be used for unsubscription.</returns>
    string Subscribe(string instanceName, IActorRef subscriber);

    /// <summary>
    /// Removes all subscriptions for the given actor.
    /// </summary>
    void RemoveSubscriber(IActorRef subscriber);
}
