SystemdInhibitPowerRunner class final

Linux runner (best-effort): systemd-inhibit holding idle (and, at the system level, sleep) inhibition while its watchdog command lives — the watchdog polls the fa pid, so the assertion dies with the fa process even if fa is SIGKILLed.

Containers and systemd-less hosts have no systemd-inhibit (issue #605): the spawn fails with ENOENT (errno 2), which this runner caches and answers with a SILENT no-op from then on — the runner is constructed once per host process, so the failed spawn happens at most once instead of warning after every run. Other failures propagate for the controller to warn about, as before.

Implemented types

Constructors

SystemdInhibitPowerRunner({required int pid, PowerProcessLauncher? launcher})

Properties

hashCode int
The hash code for this object.
no setterinherited
pid int
The fa process id the watchdog polls (kill -0).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

acquire(PowerAssertionOptions options) Future<PowerAssertionHandle>
Starts holding an assertion with options; throws when the helper cannot be spawned (the caller warns and continues).
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