Issue #10: implement worker process launcher
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace MxGateway.Server.Workers;
|
||||
|
||||
public sealed class WorkerProcessStartedProbe : IWorkerStartupProbe
|
||||
{
|
||||
public Task WaitUntilReadyAsync(
|
||||
IWorkerProcess process,
|
||||
WorkerProcessLaunchRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (process.HasExited)
|
||||
{
|
||||
throw new WorkerProcessLaunchException(
|
||||
WorkerProcessLaunchErrorCode.StartupFailed,
|
||||
$"Worker process exited before startup completed with exit code {process.ExitCode}.");
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user