View Source Elsa.Group.Manager.WorkerSupervisor (Elsa.fi v3.2.0)
Provides functions to encapsulate the management of worker processes by the consumer group manager.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
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.
Start the main Supervisor. On init this will start a single DynamicSupervisor as a child.
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.
Terminate all workers under the supervisor, giving them a chance to exit gracefully.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec 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 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.
@spec start_link(keyword()) :: GenServer.on_start()
Start the main Supervisor. On init this will start a single DynamicSupervisor as a child.
Options: :connection - Elsa.connection that will identify this supervisor in the Elsa registry.
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.
@spec stop_all_workers(Elsa.connection(), map(), list()) :: map()
Terminate all workers under the supervisor, giving them a chance to exit gracefully.
Options: :restart_supervisor - if true, this function will restart the dynamic supervisor after killing it off.
Default true.