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

Task registry for Celery applications (ported from `celery.app.registry.TaskRegistry`).

Maintains a global ETS table mapping task names to `%Celery.Task.Definition{}` structs,
while also supporting per-app task maps on `%Celery{}`.

# `all`

```elixir
@spec all(map() | nil) :: %{required(String.t()) =&gt; map()}
```

Returns all registered tasks as a map of `%{name => task_def}`, merging global and app-specific tasks.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `fetch!`

```elixir
@spec fetch!(String.t(), map() | nil) :: map()
```

Fetches a task definition by name or raises `Celery.NotRegistered`.

# `keys`

```elixir
@spec keys(map() | nil) :: [String.t()]
```

Returns a sorted list of all registered task names.

# `load_include`

```elixir
@spec load_include(module() | String.t()) :: [map()]
```

Resolves a module from either an Elixir module atom (`Src.Tasks`) or a Python-style
dotted module string (`"src.tasks"` -> `Src.Tasks`), loads its `__celery_tasks__/0`
definitions if present, and registers them.

# `lookup`

```elixir
@spec lookup(String.t(), map() | nil) ::
  {:ok, map()} | {:error, Celery.NotRegistered.t()}
```

Looks up a task definition by name in an optional app's local registry or the global registry.

# `module_candidates`

```elixir
@spec module_candidates(String.t()) :: [module()]
```

Converts a Python-style dotted module name (e.g. `"src.tasks"`) or Elixir module string
(e.g. `"Src.Tasks"`, `"Elixir.Src.Tasks"`) into candidate Elixir module atoms.

# `python_module_name`

```elixir
@spec python_module_name(module()) :: String.t()
```

Converts an Elixir module atom into a Python-style dotted module string
(e.g. `Src.Tasks` -> `"src.tasks"`).

# `register`

```elixir
@spec register(map()) :: :ok
```

Registers a `%Celery.Task.Definition{}` in the global registry.

# `start_link`

Starts the global Celery task registry.

# `unregister`

```elixir
@spec unregister(String.t()) :: :ok
```

Unregisters a task by name from the global registry.

---

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