LibTmux.Deadline (libtmux v0.0.1-alpha.1)

Copy Markdown View Source

A node-local monotonic deadline shared by every stage of an operation.

Construct it once at admission. Passing it between stages preserves the original budget; it is not a portable timestamp or a wire value.

Summary

Types

An optional node-local monotonic clock sample in milliseconds, used instead of sampling the current clock.

t()

A node-local monotonic millisecond cutoff. Share it between stages; never serialize it as a portable deadline.

Functions

Creates a deadline from a positive millisecond budget.

Returns the remaining milliseconds, clamped to zero after expiry.

Types

option()

@type option() :: {:now, integer()}

An optional node-local monotonic clock sample in milliseconds, used instead of sampling the current clock.

t()

@opaque t()

A node-local monotonic millisecond cutoff. Share it between stages; never serialize it as a portable deadline.

Functions

new(milliseconds, options \\ [])

@spec new(pos_integer(), [option()]) :: t()

Creates a deadline from a positive millisecond budget.

remaining(deadline, options \\ [])

@spec remaining(t(), [option()]) :: non_neg_integer()

Returns the remaining milliseconds, clamped to zero after expiry.