# `Pulsar.PartitionedConsumer`
[🔗](https://github.com/efcasado/pulsar-elixir/blob/main/lib/pulsar/partitioned_consumer.ex#L1)

A supervisor that manages individual consumer groups for partitioned topics.

This module provides a logical abstraction over multiple consumer groups,
allowing the `start_consumer` API to return a single PID for partitioned topics
while maintaining the individual consumer group architecture underneath.

The supervisor manages one consumer group per partition, with the number of
partitions provided by the caller.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_consumers`

Gets all consumer processes from all partition groups managed by this supervisor.

Returns a flat list of consumer process PIDs from all partitions.

# `get_partition_groups`

Gets information about all child consumer groups managed by this supervisor.

Returns a list of `{partition_topic, group_pid}` tuples.

# `start_link`

Starts a partitioned consumer supervisor.

## Parameters

- `name` - Unique name for this partitioned consumer
- `topic` - The base partitioned topic name (without partition suffix)
- `partitions` - Number of partitions for this topic
- `subscription_name` - Name of the subscription
- `subscription_type` - Type of subscription (e.g., :Exclusive, :Shared, :Key_Shared)
- `callback_module` - Module that implements `Pulsar.Consumer.Callback` behaviour
- `opts` - Additional options passed to individual consumer groups

## Returns

`{:ok, pid}` - The supervisor PID that manages all partition consumer groups
`{:error, reason}` - Error if the supervisor failed to start

# `stop`

Stops a partitioned consumer supervisor and all its child consumer groups.

---

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