Trait event_engine::plugins::Plugin
source · [−]pub trait Plugin: Sync + Send {
fn start(
&self,
pub_socket: Socket,
sub_socket: Socket
) -> Result<(), EngineError>;
fn get_subscriptions(&self) -> Result<Vec<Box<dyn EventType>>, EngineError>;
fn get_id(&self) -> Uuid;
}Expand description
Public API for defining the internal plugins. Internal plugns are plugins that run within the main application process in a child thread. In particular, all internal plugins must be written in Rust.
Required Methods
The entry point for the plugin. The engine will start the plugin in its own thread and execute this function. the pub_socket is used by the plugin to publish new events. the sub_socket is used by the plugin to get events published by other plugins.
sourcefn get_subscriptions(&self) -> Result<Vec<Box<dyn EventType>>, EngineError>
fn get_subscriptions(&self) -> Result<Vec<Box<dyn EventType>>, EngineError>
Return the event subscriptions, as a vector of strings, that this plugin is interested in.