waitTimeout

Waits until either the process associated with pid terminates or the elapsed time exceeds the given timeout.

If the process terminates within the given duration it behaves exactly like wait, except that it returns a tuple (true, exit code).

If the process does not terminate within the given duration it will stop waiting and return (false, 0).

The timeout may not exceed (uint.max - 1).msecs (~ 7 weeks, 17 hours).

This function is Windows-Only.

version(StdDdoc)
@safe
Tuple!(bool, "terminated", int, "status")
waitTimeout
(,
Duration timeout
)

Return Value

Type: Tuple!(bool, "terminated", int, "status")

An std.typecons.Tuple!(bool, "terminated", int, "status").

Throws

ProcessException on failure or on attempt to wait for detached process.

Examples

See the spawnProcess documentation.

See Also

wait, for a blocking function without timeout. tryWait, for a non-blocking function without timeout.

Meta