Expand description
Runtime-mutable plugin routes under the /_plugins namespace.
The core router stays frozen — dynamism is confined to one catch-all
mounted at /_plugins/*rest, which dispatches through an
ArcSwap<HashMap> table. The hot path inside the namespace pays one
atomic load + one hash lookup; routes outside the namespace pay nothing.
Mount/unmount use rcu (clone-and-swap), so writers never block readers.
Mutations are expected to be rare (feature flags, tenant provisioning) —
the table clone on write is the deliberate trade for a lock-free read.
Paths are matched exactly (no :params), consistent with static
plugin routes being mounted verbatim. Dynamic handlers receive the same
RequestContext as every other route.
Structs§
- Dynamic
Route Table - Process-wide table of runtime-mounted routes. Automatically provided in
the DI container — resolve with
Inject<DynamicRouteTable>(orctx.inject::<DynamicRouteTable>()) and mount/unmount at any time.
Constants§
- DYNAMIC_
PREFIX - Namespace prefix for all dynamic routes.