# `Portals.Callback`
[🔗](https://github.com/Ziinc/portals/blob/v0.1.0/lib/portals/callback.ex#L1)

Introspection helper for code running inside a callback handler
(invoked by `Portals.Connection` in response to a worker's `CALLBACK`
frame). See protocol/v1.md section 8 for the reentrancy-depth model.

# `depth`

```elixir
@spec depth() :: non_neg_integer()
```

The current reentrancy depth, or `0` outside of any callback handler.
Any `Portals.call/5`/`async/5` issued while this is non-zero
automatically carries it forward so the worker can correctly report
its own next nesting level.

---

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