# `PtcRunner.Kernel.Deadline`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/deadline.ex#L1)

Absolute monotonic deadline shared by bounded Kernel operations.

A deadline is anchored once. Passing it to nested work preserves the same
cutoff; callers may select an earlier deadline but cannot extend one by
reconstructing a relative timeout.

# `t`

```elixir
@opaque t()
```

# `earliest`

```elixir
@spec earliest(t(), t()) :: t()
```

Selects the earlier of two already-anchored deadlines.

# `expired?`

```elixir
@spec expired?(t()) :: boolean()
```

Returns whether the monotonic cutoff has been reached.

# `new`

```elixir
@spec new(pos_integer()) :: t()
```

# `new`

```elixir
@spec new(pos_integer(), integer()) :: t()
```

Creates a deadline from a shared monotonic anchor.

# `remaining`

```elixir
@spec remaining(t()) :: non_neg_integer()
```

Returns the non-negative duration remaining before the cutoff.

# `terminalization`

```elixir
@spec terminalization(integer()) :: t()
```

Budget for recording an outcome that must outlive the caller's deadline.

A worker that crossed a dispatch fence has to report how the dispatch
ended even when it learns that outcome after the caller's cutoff.
Budgeting that report with `max(remaining, 1)` gave the store call one
millisecond once the deadline had passed; under load the call timed out,
the discarded report left the mutation lease `:dispatched`, and every
later acquire returned `:mutation_indeterminate`. The floor keeps any
longer live budget and never lets the report's allowance collapse with
the caller's.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
