Celery.Tracer (celery v0.1.0)

Copy Markdown View Source

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

Summary

Functions

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

Types

trace_outcome()

@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()}

Functions

trace_task(app, ctx, revoked_set \\ MapSet.new())

@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.