28 lines
672 B
C#
28 lines
672 B
C#
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<WorkerCommandReply> InvokeAsync(
|
|
WorkerCommand command,
|
|
TimeSpan timeout,
|
|
CancellationToken cancellationToken);
|
|
|
|
IAsyncEnumerable<WorkerEvent> ReadEventsAsync(CancellationToken cancellationToken);
|
|
|
|
Task ShutdownAsync(TimeSpan timeout, CancellationToken cancellationToken);
|
|
|
|
void Kill(string reason);
|
|
}
|