PtcLlmHttp.Runtime (PtcLlmHttp v0.1.0)

Copy Markdown View Source

Fail-fast physical-attempt admission and ownership runtime.

Each runtime is an independent capacity domain. Global and per-group limits are reserved atomically, and a reservation is released only after the guardian has observed the complete attempt tree go down. Runtime generation failure fences old counters instead of resetting them under surviving work.

Summary

Functions

Returns whether the current runtime generation is ready to admit.

Returns a bounded global and per-group admission counter snapshot.

Starts an independent physical-connection capacity domain linked to its owner.

Types

option()

@type option() ::
  {:max_concurrency, pos_integer()}
  | {:groups, %{required(binary()) => pos_integer()}}

t()

@type t() :: pid()

Functions

ready?(runtime)

@spec ready?(t()) :: boolean()

Returns whether the current runtime generation is ready to admit.

snapshot(runtime)

@spec snapshot(t()) :: {:ok, map()} | {:error, PtcLlmHttp.Error.t()}

Returns a bounded global and per-group admission counter snapshot.

start_link(options)

@spec start_link([option()]) :: {:ok, t()} | {:error, PtcLlmHttp.Error.t()}

Starts an independent physical-connection capacity domain linked to its owner.