# `PhoenixMicro.Supervisor.ConsumerManager`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/supervisor.ex#L168)

DynamicSupervisor that manages all registered consumer worker processes.
Consumers are registered either:
1. Statically via `PhoenixMicro.register_consumer/1` at app start.
2. Dynamically at runtime via `PhoenixMicro.Supervisor.ConsumerManager.start_consumer/1`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `running_consumers`

```elixir
@spec running_consumers() :: [module()]
```

Returns a list of all running consumer modules.

# `start_consumer`

```elixir
@spec start_consumer(module()) :: DynamicSupervisor.on_start_child()
```

Starts the processing pipeline for the given consumer module.

Chooses between `PhoenixMicro.Pipeline` (Broadway-backed, default) and
the legacy `PhoenixMicro.Consumer.Worker` (Task-based) depending on the
consumer's `pipeline` setting:

    pipeline :broadway   # default — full backpressure, batch support
    pipeline :simple     # legacy — Task.start dispatch

Idempotent — if the consumer is already running, returns `{:ok, pid}`.

# `start_link`

```elixir
@spec start_link(keyword()) :: Supervisor.on_start()
```

# `stop_consumer`

```elixir
@spec stop_consumer(module()) :: :ok | {:error, :not_found}
```

Stops a running consumer (works for both Broadway and Worker modes).

---

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