Extension-owned routing process for provider selection and failover.
Summary
Types
Provider health information for routing decisions.
Unique provider candidate identifier used by this router instance.
Provider selection result returned by select_provider/2.
Functions
Returns a specification to start this module under a supervisor.
Types
@type health_status() :: ASM.Extensions.Routing.HealthTracker.health_status()
Provider health information for routing decisions.
@type provider_id() :: ASM.Extensions.Routing.HealthTracker.provider_id()
Unique provider candidate identifier used by this router instance.
@type selection() :: %{id: provider_id(), provider: atom(), provider_opts: keyword()}
Provider selection result returned by select_provider/2.
@type t() :: %ASM.Extensions.Routing.Router{ candidates: [candidate()], clock: clock_fun(), health_tracker: ASM.Extensions.Routing.HealthTracker.t(), strategy: strategy_module(), strategy_state: ASM.Extensions.Routing.Strategy.state() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec health_snapshot(pid()) :: {:ok, %{required(provider_id()) => health_status()}} | {:error, ASM.Error.t()}
@spec provider_health(pid(), provider_id()) :: {:ok, health_status()} | {:error, ASM.Error.t()}
@spec report_failure(pid(), selection() | provider_id(), term()) :: :ok | {:error, ASM.Error.t()}
@spec report_success(pid(), selection() | provider_id()) :: :ok | {:error, ASM.Error.t()}
@spec select_provider( pid(), keyword() ) :: {:ok, selection()} | {:error, ASM.Error.t()}
@spec start_link(keyword()) :: GenServer.on_start()