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 pid for 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 pid is currently alive.
override
kill(int pid, {Duration grace = const Duration(seconds: 3)}) → Future<bool>
Stops pid after verifying its identity. Unix hosts try SIGTERM, wait up to grace, then SIGKILL if still alive; Windows uses the process termination available through Dart's Process.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