namespace ZB.MOM.WW.MxGateway.Server.Workers;
/// Handle to a running worker process with metadata.
public sealed class WorkerProcessHandle : IDisposable
{
/// Initializes a new instance of the WorkerProcessHandle class.
/// The underlying worker process.
/// The command line and arguments used to launch the process.
/// The time when the process was launched.
public WorkerProcessHandle(
IWorkerProcess process,
WorkerProcessCommandLine commandLine,
DateTimeOffset launchedAt)
{
Process = process;
ProcessId = process.Id;
CommandLine = commandLine;
LaunchedAt = launchedAt;
}
/// Gets the underlying worker process.
public IWorkerProcess Process { get; }
/// Gets the process ID.
public int ProcessId { get; }
/// Gets the command line and arguments used to launch the process.
public WorkerProcessCommandLine CommandLine { get; }
/// Gets the time when the process was launched.
public DateTimeOffset LaunchedAt { get; }
///
public void Dispose()
{
Process.Dispose();
}
}