Loads relay plugins and monitors allocation lifetimes.
What problem this solves
XTurn extensions implement the plugin behaviour to observe or transform relay
traffic (logging, recording, policy). This GenServer reads :plugins from
application env, validates callback exports, caches the enabled list in
:persistent_term, and registers Process.monitor/1 refs for allocation
owners and passive plugin instances.
When an allocation owner exits, teardown runs in a spawned process so slow
handle_close/2 callbacks cannot block monitor handling. Call reload/0
after changing plugin config at runtime.
RFCs
- RFC 5766 (TURN relay path plugins attach to)
Summary
Functions
Returns a specification to start this module under a supervisor.
Reads a framework option from plugin config with a default.
Returns plugin-specific options, stripping framework keys.
Returns the enabled plugin list loaded from application env.
Reloads the plugin list from application env and updates :persistent_term.
Starts the plugin manager (registered as __MODULE__).
Registers monitors for one allocation: its owning Allocate.Client and each of
its passive instances.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Reads a framework option from plugin config with a default.
Returns plugin-specific options, stripping framework keys.
Returns the enabled plugin list loaded from application env.
Reloads the plugin list from application env and updates :persistent_term.
Starts the plugin manager (registered as __MODULE__).
Registers monitors for one allocation: its owning Allocate.Client and each of
its passive instances.
Synchronous on purpose. A cast could land after the monitored process had already
died, and Process.monitor/1 on a dead pid reports :noproc rather than the real
exit reason -- which is exactly the reason plugins are told about in
handle_close/2. One call per allocation, never per frame.