pub enum PluginInfoReq<Codec = Default> {
Close {
__reply_tx: Sender<RemoteResult<()>, Codec>,
},
Manifest {
__reply_tx: Sender<Result<Manifest, CallError>, Codec>,
},
LoadConfig {
__reply_tx: Sender<RemoteResult<(Vec<StreamImpl>, Vec<ActionImpl>)>, Codec>,
streams: Vec<StreamConfig>,
actions: Vec<ActionConfig>,
},
Start {
__reply_tx: Sender<RemoteResult<()>, Codec>,
},
// some variants omitted
}Expand description
Request generated by calling a method on PluginInfo.
When matching on this, use a wildcard match _ to ignore all unknown variants.
Variants§
Close
Notify the plugin that reaction is quitting and that the plugin should quit too. A few seconds later, the plugin will receive SIGTERM. A few seconds later, the plugin will receive SIGKILL.
Function called after PluginInfo::start, when reaction is quitting.
Fields
__reply_tx: Sender<RemoteResult<()>, Codec>Reply channel for sending the result of the method invocation.
The channel is closed when the calling async method is cancelled or a connection error occurs.
Manifest
Return the manifest of the plugin. This should not be dynamic, and return always the same manifest.
Example implementation:
Ok(Manifest {
hello: Hello::new(),
streams: BTreeSet::from(["mystreamtype".into()]),
actions: BTreeSet::from(["myactiontype".into()]),
})First function called.
Fields
LoadConfig
Load all plugin stream and action configurations. Must error if config is invalid.
The plugin should not start running mutable commands here: It should be ok to quit without cleanup for now.
Each StreamConfig from the streams arg should result in a corresponding StreamImpl returned, in the same order.
Each ActionConfig from the actions arg should result in a corresponding ActionImpl returned, in the same order.
Function called after PluginInfo::manifest.
Fields
__reply_tx: Sender<RemoteResult<(Vec<StreamImpl>, Vec<ActionImpl>)>, Codec>Reply channel for sending the result of the method invocation.
The channel is closed when the calling async method is cancelled or a connection error occurs.
streams: Vec<StreamConfig>streams parameter
actions: Vec<ActionConfig>actions parameter
Start
Notify the plugin that setup is finished, permitting a last occasion to report an error that’ll make reaction exit. All initialization (opening remote connections, starting streams, etc) should happen here.
Function called after PluginInfo::load_config.
Fields
__reply_tx: Sender<RemoteResult<()>, Codec>Reply channel for sending the result of the method invocation.
The channel is closed when the calling async method is cancelled or a connection error occurs.