using MxGateway.Contracts.Proto; namespace MxGateway.Server.Workers; public interface IWorkerClient : IAsyncDisposable { string SessionId { get; } int? ProcessId { get; } WorkerClientState State { get; } DateTimeOffset LastHeartbeatAt { get; } Task StartAsync(CancellationToken cancellationToken); Task InvokeAsync( WorkerCommand command, TimeSpan timeout, CancellationToken cancellationToken); IAsyncEnumerable ReadEventsAsync(CancellationToken cancellationToken); Task ShutdownAsync(TimeSpan timeout, CancellationToken cancellationToken); void Kill(string reason); }