Files
mxaccessgw/src/MxGateway.Server/Workers/SystemWorkerProcessFactory.cs
T
2026-04-26 16:45:42 -04:00

23 lines
515 B
C#

using System.Diagnostics;
namespace MxGateway.Server.Workers;
public sealed class SystemWorkerProcessFactory : IWorkerProcessFactory
{
public IWorkerProcess Start(ProcessStartInfo startInfo)
{
Process process = new()
{
StartInfo = startInfo,
};
if (!process.Start())
{
process.Dispose();
throw new InvalidOperationException("Worker process failed to start.");
}
return new SystemWorkerProcess(process);
}
}