# `BB.Command.ResultCache`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/command/result_cache.ex#L5)

Caches command results for retrieval after the command process terminates.

This handles the race condition where a fast command completes before
`await/2` is called. The Command.Server stores its result here before
terminating, and `await/2` can retrieve it if the process is already dead.

Results are automatically cleaned up after a configurable TTL.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `fetch_and_delete`

```elixir
@spec fetch_and_delete(pid()) :: {:ok, term()} | :error
```

Fetches and removes a cached result for the given pid.

Returns `{:ok, result}` if found, `:error` if not cached.

# `start_link`

Starts the result cache.

# `store`

```elixir
@spec store(pid(), term()) :: :ok
```

Stores a command result, keyed by the command process pid.

Called by Command.Server in terminate/2 before the process exits.

---

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