PtcLlmHttp.Deadline (PtcLlmHttp v0.1.0)

Copy Markdown View Source

An absolute deadline on the monotonic millisecond clock.

The low-level API has no relative timeout. Every phase derives its remaining time from this one value, so no phase resets the operation budget.

Summary

Functions

Constructs a deadline from an absolute System.monotonic_time/1 value.

Returns positive milliseconds remaining, or the closed deadline error.

Types

t()

@opaque t()

Functions

new(monotonic_millisecond)

@spec new(integer()) :: {:ok, t()} | {:error, PtcLlmHttp.Error.t()}

Constructs a deadline from an absolute System.monotonic_time/1 value.

remaining(deadline)

@spec remaining(t()) :: {:ok, pos_integer()} | {:error, PtcLlmHttp.Error.t()}

Returns positive milliseconds remaining, or the closed deadline error.