Skip to main content

collect_plugin_events

Function collect_plugin_events 

Source
pub fn collect_plugin_events(
    pending: ResMut<'_, PendingPluginEvents>,
    written: MessageReader<'_, '_, PluginEvent>,
    out: MessageWriter<'_, ScriptCommandEvent>,
)
Expand description

Move the events plugins and capabilities pushed into PendingPluginEvents. Host-neutral and registered once, so a handler call is offered to every active host rather than taken by whichever ran first; a PluginEvent::Commands batch goes straight onto the command bus here instead, so it applies once however many hosts run.

Events come from two places. The cross-thread bus (lumen_core::plugin_events) carries what other threads pushed: an event pushed from the engine’s own address space arrives as the value, and one a portable plugin pushed arrives encoded and is decoded here. A page loads no portable plugin, so the browser build carries no decoder. Then the PluginEvent messages main-thread systems wrote, in the order they wrote them; a writer ordered before this system is delivered on its own tick.