Interface IOwnedProcess
A process this run started and must stop: an owned dedicated server (DirectServerProcess,
HostServerProcess), an owned client (ClientSession's launch, InteractiveClientProcess)
or a helper such as a CliTunnel's ssh forward. The seam lets fast tests drive the real startup, restart and
stop rules without Unity: use FakeOwnedProcess.
public interface IOwnedProcess
Properties
HasExited
bool HasExited { get; }
Property Value
- bool
Id
int Id { get; }
Property Value
- int
Methods
Stop(TimeSpan)
Kills the process at once and waits up to timeout for it to exit.
void Stop(TimeSpan timeout)
Parameters
timeoutTimeSpan
StopCleanly(TimeSpan, TimeSpan)
Asks the process to quit, waits up to quit for it to exit, and kills it (Stop(TimeSpan) with
kill) only if it has not. Returns how it ended. A process that cannot be asked is killed at once,
which this default does: implementations that can ask override it.
ProcessStop StopCleanly(TimeSpan quit, TimeSpan kill)
Parameters
quitTimeSpankillTimeSpan
Returns
WaitForExitAsync(CancellationToken)
Completes with the exit code when the process exits; startup fails as soon as it does.
Task<int> WaitForExitAsync(CancellationToken cancellation)
Parameters
cancellationCancellationToken
Returns
- Task<int>