# `Feel.Runtime.Budget`
[🔗](https://github.com/FeeJai/BDM/blob/feel-v0.1.0/apps/feel/lib/feel/runtime/budget.ex#L1)

A cumulative budget for sequential runs in one process.

`within/1` owns and removes the counters, including on an exception. Pass its handle as
`budget:` to each FEEL run. Each environment receives the remaining limits and reports
its consumption once, without adding a lookup to every runtime operation. Diagnostics
and call depth remain local to the expression; their count and total calls share the budget.
A handle cannot be used outside its scope or from another process.
An unexpected exception, throw or exit invalidates the handle: the partial environment
is unavailable for metering, so later runs fail closed instead of receiving a fresh budget.

# `t`

```elixir
@opaque t()
```

# `within`

```elixir
@spec within((t() -&gt; result)) :: result when result: term()
```

Runs a function with a fresh, process-owned budget handle and always removes its counters.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
