- Fix drain_connections missing {:noreply, socket} wrapper
- Fix get_callsign_key to match atom keys from Ecto structs
- Add SpatialPubSub.broadcast_packet to PacketDistributor
- Fix pid_alive? treating {:badrpc, _} as truthy
- Fix SpatialPubSub ensure_float crash on integer strings
- Fix inverted memory calculation in ConnectionMonitor
- Remove dead SSL handler from Is module, consolidate into handle_socket_data
- Remove duplicate packet transformation in Is.dispatch
- Remove invalid placeholders option from insert_all calls
- Change PacketPipelineSupervisor to :rest_for_one strategy
- Update TODO.md marking fixed items
25 lines
776 B
Elixir
25 lines
776 B
Elixir
defmodule Aprsme.PacketPipelineSupervisor do
|
|
@moduledoc """
|
|
Supervisor for the GenStage pipeline that handles packet processing.
|
|
"""
|
|
use Supervisor
|
|
|
|
def start_link(opts \\ []) do
|
|
Supervisor.start_link(__MODULE__, opts, name: __MODULE__)
|
|
end
|
|
|
|
@impl true
|
|
def init(_opts) do
|
|
config = Application.get_env(:aprsme, :packet_pipeline, [])
|
|
|
|
# Configure producer with correct buffer size from config
|
|
producer_spec = {Aprsme.PacketProducer, max_buffer_size: config[:max_buffer_size] || 1000}
|
|
|
|
# Use consumer pool for better throughput
|
|
consumer_pool_spec = {Aprsme.PacketConsumerPool, num_consumers: config[:num_consumers] || 3}
|
|
|
|
children = [producer_spec, consumer_pool_spec]
|
|
|
|
Supervisor.init(children, strategy: :rest_for_one)
|
|
end
|
|
end
|