Attaches and detaches relay plugins when allocations start and end.
What problem this solves
Plugins must bind to a specific TURN allocation for their lifetime: active
modules run inline on each frame; passive modules get a dedicated GenServer.
This module builds the per-allocation Plugin.Chain from configured modules,
writes it to Plugin.Table, registers monitors via Plugin.Manager, and
tears down passive instances with the allocation's actual exit reason.
Called from allocation setup and owner monitor paths. Errors are logged and never fail the underlying Allocate.
RFCs
Summary
Functions
Detaches plugins and stops passive instances for a ended allocation.
Attaches plugins for a new allocation and registers teardown monitors.
Functions
Detaches plugins and stops passive instances for a ended allocation.
Atomically claims the chain row via Table.take/1 so concurrent teardown
paths cannot both act on the same instances.
Attaches plugins for a new allocation and registers teardown monitors.
Writes the plugin chain to Plugin.Table before registering monitors so a
concurrent :DOWN cannot arrive before the row exists.