# `Celery.Tracer`
[🔗](https://github.com/hacktobeer/celery-elixir/blob/v0.1.0/lib/celery/tracer.ex#L1)

Task execution tracer (ported from `celery.app.trace.build_tracer`).

Handles the complete lifecycle of executing a single `%Celery.Task.Context{}`:
- Revocation and expiration checks
- `STARTED` state tracking (`task_track_started`)
- Task invocation with optional hard time limit (`time_limit`)
- `SUCCESS` result persistence (`Celery.Backend.Redis.mark_as_done/4`)
- `callbacks` and `chain` continuation dispatch
- `RETRY` handling (both explicit `Celery.Task.retry/2` and automatic `autoretry_for`)
- `Ignore` and `Reject` handling
- `FAILURE` persistence and `errbacks` dispatch

# `trace_outcome`

```elixir
@type trace_outcome() ::
  {:ok, term()}
  | {:retry, Celery.Retry.t()}
  | {:ignore, Celery.Ignore.t()}
  | {:reject, Celery.Reject.t()}
  | {:revoked, String.t()}
  | {:error, Exception.t(), String.t()}
```

# `trace_task`

```elixir
@spec trace_task(Celery.t(), Celery.Task.Context.t(), MapSet.t()) :: trace_outcome()
```

Executes a task described by `context` using `app` and optional `revoked_set`.

---

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