pub struct NylonRingHost { /* private fields */ }Expand description
The main host for loading and managing nylon-ring plugins.
Implementations§
Source§impl NylonRingHost
impl NylonRingHost
Sourcepub fn with_stream_capacity(stream_capacity: usize) -> Self
pub fn with_stream_capacity(stream_capacity: usize) -> Self
Create a host with a bounded per-stream frame capacity.
Sourcepub fn load(&mut self, name: &str, path: &str) -> Result<()>
pub fn load(&mut self, name: &str, path: &str) -> Result<()>
Load a plugin from the specified path with a given name.
The plugin must export nylon_ring_get_plugin and match this host’s
ABI_VERSION exactly.
Sourcepub fn load_pinned(&mut self, name: &str, path: &str) -> Result<()>
pub fn load_pinned(&mut self, name: &str, path: &str) -> Result<()>
Load a plugin that opts out of unload/reload for the life of the process.
Per-call guards on a pinned plugin skip the in-flight tracker RMWs
(the dominant per-call cost on short paths); in exchange the plugin
can never be unloaded, reloaded, or replaced, its shutdown callback
never runs, and its library handle is intentionally leaked at host
drop. Streams still take tracker slots.
Sourcepub async fn unload_with_grace(
&mut self,
name: &str,
grace: Duration,
) -> Result<()>
pub async fn unload_with_grace( &mut self, name: &str, grace: Duration, ) -> Result<()>
Stop accepting new calls, then wait for tracked calls to drain.
Sourcepub async fn reload_with_grace(&mut self, grace: Duration) -> Result<()>
pub async fn reload_with_grace(&mut self, grace: Duration) -> Result<()>
Reload all plugins and wait for calls on replaced instances to drain.
Sourcepub fn plugin(&self, name: &str) -> Option<PluginHandle>
pub fn plugin(&self, name: &str) -> Option<PluginHandle>
Get a handle to a loaded plugin by name.
Sourcepub fn metrics(&self) -> HostMetrics
pub fn metrics(&self) -> HostMetrics
Capture lightweight host metrics without allocating the shard map.