Gust.Leader (gust v0.1.26)

Elects a single leader node and manages leader-only children.

The leader process attempts to acquire a distributed lock in the database. When the lock is held, the node becomes the leader and starts the configured leader-only workers under Gust.LeaderOnlySupervisor. If the lock is lost, the leader-only workers are terminated and the node returns to follower mode.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Functions

attempt_lock()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

handle_continue(atom, state)

Callback implementation for GenServer.handle_continue/2.

init(args)

Callback implementation for GenServer.init/1.

start_link(args)