FromTimeSpan(TimeSpan, ProcessExitBehaviour) Method

Definition

Namespace CliInvoke.Core
Assembly CliInvoke.Core.dll

Creates an instance of ProcessTimeoutPolicy using the specified timeout threshold and an optional cancellation mode.

public static ProcessTimeoutPolicy FromTimeSpan(TimeSpan timeoutThreshold, ProcessExitBehaviour exitBehaviour = ProcessExitBehaviour.GracefulExit)

Parameters

timeoutThreshold
TimeSpan

The maximum duration to wait before the process is considered timed out.

exitBehaviour
ProcessExitBehaviour

The method of cancellation to apply when the timeout threshold is reached. Defaults to GracefulExit.

Returns

ProcessTimeoutPolicy
A new instance of ProcessTimeoutPolicy configured with the specified parameters.