elsa v0.12.3 Elsa.Group.Manager.WorkerManager
Provides functions to encapsulate the management of worker processes by the consumer group manager.
Link to this section Summary
Functions
Retrieve the generation id, used in tracking assignments of workers to topic/partition, from the worker state map.
Restart the specified worker from the manager state. Retrieve the latest recorded offset and pass it to the new worker to pick up where the previous left off if it has been recorded.
Construct an argument payload for instantiating a worker process, generate a topic/partition assignment and instantiate the worker process with both under the dynamic supervisor. Record the manager-relevant information and store in the manager state map tracking active worker processes.
Iterate over all workers managed by the group manager and issue the unsubscribe call to disengage from the topic/partition and shut down gracefully.
Link to this section Functions
get_generation_id(workers, topic, partition)
get_generation_id(map(), Elsa.topic(), Elsa.partition()) :: Elsa.Group.Manager.generation_id()
Retrieve the generation id, used in tracking assignments of workers to topic/partition, from the worker state map.
restart_worker(workers, ref, state)
Restart the specified worker from the manager state. Retrieve the latest recorded offset and pass it to the new worker to pick up where the previous left off if it has been recorded.
start_worker(workers, generation_id, assignment, state)
Construct an argument payload for instantiating a worker process, generate a topic/partition assignment and instantiate the worker process with both under the dynamic supervisor. Record the manager-relevant information and store in the manager state map tracking active worker processes.
stop_all_workers(connection, workers)
stop_all_workers(Elsa.connection(), map()) :: map()
Iterate over all workers managed by the group manager and issue the unsubscribe call to disengage from the topic/partition and shut down gracefully.