Imp.Training.FastSlow.Budget (Imp v0.5.0)

Copy Markdown View Source

Named immutable limits and accumulated usage for a training run.

Summary

Types

t()

@type t() :: %Imp.Training.FastSlow.Budget{
  limits: %{required(String.t()) => non_neg_integer()},
  used: %{required(String.t()) => non_neg_integer()}
}

Functions

charge(budget, key, amount)

@spec charge(t(), String.t() | atom(), non_neg_integer()) ::
  {:ok, t()} | {:error, :exhausted}

new!(limits)

@spec new!(map()) :: t()

validate!(budget)

@spec validate!(t()) :: t()