Backplane.AgentRuntime.Budget (backplane_agent_runtime v1.6.0)

Copy Markdown

Finite root budgets and idempotent work reservations.

Reservations are replay-safe, cannot exceed a fixed quota, and do not claim provider billing exactness.

Summary

Types

t()

@type t() :: map()

Functions

new(config)

@spec new(map()) :: {:ok, t()} | {:error, Backplane.AgentRuntime.Error.t()}

release(budget, reservation_id)

@spec release(t(), String.t()) ::
  {:ok, t()} | {:error, Backplane.AgentRuntime.Error.t()}

reserve(budget, reservation_id, amount \\ 1)

@spec reserve(t(), String.t(), non_neg_integer()) ::
  {:ok, t(), map()} | {:error, Backplane.AgentRuntime.Error.t()}