Implement leader election to ensure only one APRS-IS connection across multiple Kubernetes replicas. This prevents duplicate packet processing and respects APRS-IS usage policies. Key changes: - Add leader election using :global registry - Create connection manager for dynamic APRS-IS management - Implement packet distribution from leader to all nodes - Add Kubernetes headless service for node discovery - Configure DNS-based clustering with libcluster - Update deployment to support 3 replicas with clustering 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
16 lines
463 B
Elixir
16 lines
463 B
Elixir
defmodule Aprsme.DynamicSupervisor do
|
|
@moduledoc """
|
|
Dynamic supervisor for managing processes that may be started/stopped at runtime.
|
|
Used primarily for the APRS-IS connection which is managed by cluster leadership.
|
|
"""
|
|
use DynamicSupervisor
|
|
|
|
def start_link(init_arg) do
|
|
DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
|
|
end
|
|
|
|
@impl true
|
|
def init(_init_arg) do
|
|
DynamicSupervisor.init(strategy: :one_for_one)
|
|
end
|
|
end
|