Packages
A spec-compliant Open Responses server for Elixir and Phoenix, with pluggable provider adapters and first-class streaming.
Current section
Files
Jump to
Current section
Files
lib/open_responses/loop_supervisor.ex
defmodule OpenResponses.LoopSupervisor do
@moduledoc """
Dynamic supervisor for agentic loop processes.
One Loop GenServer is spawned per inbound request.
"""
use DynamicSupervisor
@spec start_link(keyword()) :: Supervisor.on_start()
def start_link(init_arg) do
DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
end
@spec start_loop(map()) :: DynamicSupervisor.on_start_child()
def start_loop(opts) do
DynamicSupervisor.start_child(__MODULE__, {OpenResponses.Loop, opts})
end
@impl DynamicSupervisor
def init(_init_arg) do
DynamicSupervisor.init(strategy: :one_for_one)
end
end