HostProcessLiveness class final
Default ProcessLiveness: ps / kill -0 on macOS, /proc/<pid> on
Linux, and Windows PowerShell/CIM with machine and boot identity on
Windows.
- Implemented types
Constructors
- HostProcessLiveness()
-
Const constructor — stateless.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
identityToken(
int pid) → Future< String?> -
An identity token that changes when the OS reuses
pidfor a different process — the process start time (or equivalent). Null when the process is not alive or the token is unobtainable.override -
isAlive(
int pid) → Future< bool> -
Whether a process with OS id
pidis currently alive.override -
kill(
int pid, {Duration grace = const Duration(seconds: 3)}) → Future< bool> -
Stops
pidafter verifying its identity. Unix hosts try SIGTERM, wait up tograce, then SIGKILL if still alive; Windows uses the process termination available through Dart'sProcess.killPid. Returns false when the process could not be safely stopped.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited