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

Link to this macro

brod_received_assignment(args \\ [])

(macro)
Link to this macro

brod_received_assignment(record, args)

(macro)
Link to this function

get_generation_id(workers, topic, partition)

Retrieve the generation id, used in tracking assignments of workers to topic/partition, from the worker state map.

Link to this function

restart_worker(workers, ref, state)

restart_worker(map(), reference(), struct()) :: 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.

Link to this function

start_worker(workers, generation_id, assignment, state)

start_worker(map(), integer(), tuple(), struct()) :: map()

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.

Link to this function

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.