Logo ProcessKit API Reference

IoPriorityClass Type

The **Linux I/O-scheduling class** a child's disk work runs in — the class half of an `IoPriority`, and the axis `ionice(1)`'s `-c` option selects. A separate dimension from the portable CPU-scheduling `Priority`: that one decides how much *processor* the child gets, this one how its *block-device* requests are ordered against everyone else's. Neither implies the other, and a background job usually wants both. **Linux-only, and honestly so.** `ioprio_set(2)` is a Linux system call with no POSIX or Win32 equivalent, so a spawn carrying an `IoPriority` fails with `ProcessError.Unsupported` on Windows, macOS, and the BSDs rather than running the child at the inherited priority as if the request had been honoured (see `Command.IoPriority`).

Union cases

Union case Description

BestEffort

Full Usage: BestEffort

The ordinary Linux class every process is in unless something moved it (`IOPRIO_CLASS_BE`), with a level from `0` (highest priority) through `7` (lowest). A process that never asked for a class gets a best-effort level derived from its `nice` value; naming a level here makes that choice explicit and independent of `nice`. Needs no privilege in either direction — this is the class to reach for when `Idle` is too severe (a job that should yield but still make steady progress is `BestEffort 7`).

Idle

Full Usage: Idle

The child's I/O runs **only while the block device is otherwise idle** (`IOPRIO_CLASS_IDLE`). The politest setting there is, and the right one for bulk background work — a backup, an indexer, a large checkout — that must never slow down an interactive user. It carries no level (the kernel ignores the level field for this class). Needs no privilege: an ordinary user may put its own children in this class.

RealTime

Full Usage: RealTime

The Linux **real-time** I/O class (`IOPRIO_CLASS_RT`), with a level from `0` (highest priority) through `7` (lowest). Requests in this class are served ahead of every best-effort and idle request on the device, so a busy child here can starve the rest of the system — including processes that are not yours. Prefer `BestEffort` unless a genuine latency requirement says otherwise. **Needs privilege:** `CAP_SYS_ADMIN` (Linux ≥ 5.14 accepts `CAP_SYS_NICE` as well). Without it the kernel refuses the request and the spawn fails with `ProcessError.Spawn` — it is never quietly downgraded to best-effort.

Instance members

Instance member Description

this.IsBestEffort

Full Usage: this.IsBestEffort

Returns: bool
Returns: bool

this.IsIdle

Full Usage: this.IsIdle

Returns: bool
Returns: bool

this.IsRealTime

Full Usage: this.IsRealTime

Returns: bool
Returns: bool

this.Name

Full Usage: this.Name

Returns: string

This class's **stable machine identifier**: a short, lowercase `snake_case` string, part of the library's compatibility surface. Use it wherever a class has to travel as text — a config file's key, a CLI flag, a structured log field — instead of hand-maintaining a mapping table. It is a diagnostic identifier rather than a wire format, but it is held stable all the same: a new class gets a NEW identifier and an existing one is never renamed within a major version. `TryFromName` parses it back. Deliberately ProcessKit's own spelling rather than `ionice`'s numeric `-c` argument: the number is one tool's CLI detail, and the two must be free to differ.

Returns: string

Static members

Static member Description

IoPriorityClass.All

Full Usage: IoPriorityClass.All

Returns: IReadOnlyList<IoPriorityClass>

Every class, in a fixed order — the enumerable form of the set `Name`/`TryFromName` map between, so a config layer can validate or document the accepted spellings without keeping its own copy of the list (which could silently fall behind a new class).

Returns: IReadOnlyList<IoPriorityClass>

IoPriorityClass.FromName(name)

Full Usage: IoPriorityClass.FromName(name)

Parameters:
    name : string

Returns: IoPriorityClass

`TryFromName` for a caller that wants the miss as an error instead of an option — an unknown name raises `ArgumentException` listing every accepted spelling, so a mistyped config key fails where it is read rather than silently leaving the child at the inherited I/O priority. `null` raises `ArgumentNullException`.

name : string
Returns: IoPriorityClass

IoPriorityClass.TryFromName(name)

Full Usage: IoPriorityClass.TryFromName(name)

Parameters:
    name : string

Returns: IoPriorityClass option

Parse a stable `Name` identifier back into a class, or `None` for anything that is not EXACTLY one of them (matching is ordinal and case-sensitive: `"BestEffort"` and `"besteffort"` are both misses, only `"best_effort"` hits). An honest miss, never a silent default — a config-driven caller that mistypes a class gets nothing back to apply, instead of its child landing in a different class than the one that was written down. Round-trips with `Name` for every class.

name : string
Returns: IoPriorityClass option

Type something to start searching.