using System.Threading;
using System.Threading.Tasks;
using ZB.MOM.WW.MxGateway.Worker.Bootstrap;

namespace ZB.MOM.WW.MxGateway.Worker.Ipc;

/// <summary>Manages the worker's named pipe connection to the gateway.</summary>
public interface IWorkerPipeClient
{
    /// <summary>Connects to the gateway and runs the worker until the session ends or is cancelled.</summary>
    /// <param name="options">Configuration options.</param>
    /// <param name="cancellationToken">Token to cancel the asynchronous operation.</param>
    /// <returns>A task that represents the asynchronous operation.</returns>
    Task RunAsync(
        WorkerOptions options,
        CancellationToken cancellationToken = default);
}
