ProcessHandle
classin packageklyn.process
public class ProcessHandle implements AutoClosable
ProcessHandle
All Implemented Interfaces: AutoClosable

A stable OS process reference with explicitly requested rights. close releases the reference and NEVER kills the process. Native finalization is a fallback; deterministic try-with-resources is preferred.

Example

try task = Process.open(row.identity, [ProcessAccess.WAIT]): task.waitForExit(100ul)

Properties
Modifier and Type Member Description
public readonly property identity
identity as ProcessIdentity
No summary.
public readonly property isRunning
isRunning as Boolean
Nonblocking lifecycle query; requires QUERY or WAIT.
Methods
Modifier and Type Member Description
public close
close() as Void
Releases native ownership, never kills; idempotent and finalizer-safe.
public getPriority
getPriority() as ProcessPriority
Reads the portable priority class; requires QUERY.
public kill
kill() as Void
Forcibly terminates this instance only, with no implicit descendant kill.
public requestExit
requestExit() as Void
Requests exit through the OS mechanism (SIGTERM on Linux).
public sendSignal
sendSignal(number as Int) as Void
Sends a signal to this verified process instance, without descendants.
public setPriority
setPriority(notnull priority as ProcessPriority) as Void
Changes priority; requires SET_PRIORITY and any OS elevation needed.
public tryGetExitCode
tryGetExitCode(out code as Long) as Boolean
Reads exit status if available; false leaves code unchanged.
public waitForExit
waitForExit(timeout as ULong = 0ul) as Boolean
Waits for exit; milliseconds, 0 means infinite.
Inherited Methods
methodInherited Methods from AutoClosable: close