Logo ProcessKit API Reference

ProcessGroupOptions Type

Options applied when creating a `ProcessGroup`: the graceful-shutdown window and whole-tree resource limits.

Constructors

Constructor Description

ProcessGroupOptions()

Full Usage: ProcessGroupOptions()

Returns: ProcessGroupOptions

The defaults: a 2-second shutdown grace, `Signal.Term`, and no limits.

Returns: ProcessGroupOptions

Instance members

Instance member Description

this.Limits

Full Usage: this.Limits

Returns: ResourceLimits

The whole-tree resource caps applied at creation.

Returns: ResourceLimits

this.ShutdownTimeout

Full Usage: this.ShutdownTimeout

Returns: TimeSpan

How long `ShutdownAsync` waits after the configured `StopSignal` before escalating (default 2s).

Returns: TimeSpan

this.StopSignal

Full Usage: this.StopSignal

Returns: Signal

The soft signal sent by `ShutdownAsync` before hard-kill escalation (default `Signal.Term`).

Returns: Signal

this.WithCpuAffinity

Full Usage: this.WithCpuAffinity

Parameters:
    cores : int seq

Returns: ProcessGroupOptions

A copy pinning the tree to `cores` — the CPU cores its processes may be scheduled on (the Windows Job Object affinity mask, the Linux cgroup v2 `cpuset.cpus`). Needs a limit-capable mechanism: elsewhere `ProcessGroup.Create` fails with `ProcessError.ResourceLimit` rather than silently running the tree on every core. See `ResourceLimits.WithCpuAffinity`.

cores : int seq
Returns: ProcessGroupOptions

this.WithCpuQuota

Full Usage: this.WithCpuQuota

Parameters:
    cores : float

Returns: ProcessGroupOptions

A copy capping the tree's CPU at `cores` cores' worth.

cores : float
Returns: ProcessGroupOptions

this.WithCpuTimeMax

Full Usage: this.WithCpuTimeMax

Parameters:
Returns: ProcessGroupOptions

A copy capping CPU time for each spawned run (or the whole Job on Windows).

duration : TimeSpan
Returns: ProcessGroupOptions

this.WithIoMax

Full Usage: this.WithIoMax

Parameters:
    target : string
    readBytesPerSecond : int64
    writeBytesPerSecond : int64
    readOperationsPerSecond : int64
    writeOperationsPerSecond : int64

Returns: ProcessGroupOptions

Convenience overload using zero as the unbounded sentinel; see `ResourceLimits.WithIoMax`.

target : string
readBytesPerSecond : int64
writeBytesPerSecond : int64
readOperationsPerSecond : int64
writeOperationsPerSecond : int64
Returns: ProcessGroupOptions

this.WithIoMax

Full Usage: this.WithIoMax

Parameters:
    target : string
    readBytesPerSecond : int64 option
    writeBytesPerSecond : int64 option
    readOperationsPerSecond : int64 option
    writeOperationsPerSecond : int64 option

Returns: ProcessGroupOptions

A copy applying directional disk I/O ceilings to one explicit Linux device or Windows volume; see `ResourceLimits.WithIoMax` for target syntax and platform semantics.

target : string
readBytesPerSecond : int64 option
writeBytesPerSecond : int64 option
readOperationsPerSecond : int64 option
writeOperationsPerSecond : int64 option
Returns: ProcessGroupOptions

this.WithMaxProcesses

Full Usage: this.WithMaxProcesses

Parameters:
    count : int

Returns: ProcessGroupOptions

A copy capping the number of live processes in the tree at `count`.

count : int
Returns: ProcessGroupOptions

this.WithMemoryMax

Full Usage: this.WithMemoryMax

Parameters:
    bytes : int64

Returns: ProcessGroupOptions

A copy capping the tree's total memory at `bytes`.

bytes : int64
Returns: ProcessGroupOptions

this.WithOomGroupKill

Full Usage: this.WithOomGroupKill

Returns: ProcessGroupOptions

A copy enabling cgroup v2 whole-tree OOM kills. Linux cgroup v2-only; creation is refused with `ProcessError.Unsupported` on mechanisms that cannot provide this semantic.

Returns: ProcessGroupOptions

this.WithShutdownTimeout

Full Usage: this.WithShutdownTimeout

Parameters:
Returns: ProcessGroupOptions

A copy with the shutdown grace window set. A negative `timeout` is rejected (`ArgumentOutOfRangeException`); `TimeSpan.Zero` is valid (no grace — escalate immediately).

timeout : TimeSpan
Returns: ProcessGroupOptions

this.WithStopSignal

Full Usage: this.WithStopSignal

Parameters:
Returns: ProcessGroupOptions

A copy using `signal` for graceful shutdown before escalation.

signal : Signal
Returns: ProcessGroupOptions

this.WithUiRestrictions

Full Usage: this.WithUiRestrictions

Parameters:
Returns: ProcessGroupOptions

A copy imposing the given Windows Job Object UI restrictions on the tree (clipboard, desktop, display/system settings, exit-Windows — see `WindowsUiRestrictions`). Windows-only: off Windows `ProcessGroup.Create` fails with `ProcessError.Unsupported` rather than silently running the tree unrestricted. See `ResourceLimits.WithUiRestrictions`.

restrictions : WindowsUiRestrictions
Returns: ProcessGroupOptions

Type something to start searching.