Skip to main content

PluginEventSink

Type Alias PluginEventSink 

Source
pub type PluginEventSink = Arc<dyn Fn(Event, Option<EventAck>) -> bool + Send + Sync>;
Expand description

A host-owned sink that delivers a matched [Event] to a plugin’s on-event handler (PH7.8). Returns false when the plugin’s receiver has closed (its actor task ended), so the bus prunes the subscription lazily — the same closed-Channel / ForwardFn discipline the rest of this module uses.

The bus stays channel-agnostic. The plugin host builds this closure over its own futures::channel mpsc (the plugin-host lib keeps tokio a dev-dependency; the bus’s Channel variant uses tokio mpsc), so SubscriptionTarget never names a plugin-host or specific-channel type and lattice-runtime grows no dependency on either. The sink is invoked with the bus mutex dropped (the audit-M1 dispatch phase), so a slow plugin handler can never stall the publisher or another subscriber.

Aliased Type§

pub struct PluginEventSink { /* private fields */ }