wip
This commit is contained in:
parent
62ea26d933
commit
a36069519f
|
@ -85,16 +85,26 @@ impl PluginGc {
|
||||||
pub fn exited(&self) {
|
pub fn exited(&self) {
|
||||||
let _ = self.sender.send(PluginGcMsg::Exited);
|
let _ = self.sender.send(PluginGcMsg::Exited);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Tell the GC that our process received a Ctrl-C signal
|
||||||
|
pub fn ctrlc(&self) {
|
||||||
|
let _ = self.sender.send(PluginGcMsg::Ctrlc);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clone_sender(&self) -> mpsc::Sender<PluginGcMsg> {
|
||||||
|
self.sender.clone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum PluginGcMsg {
|
pub enum PluginGcMsg {
|
||||||
SetConfig(PluginGcConfig),
|
SetConfig(PluginGcConfig),
|
||||||
Flush(mpsc::Sender<()>),
|
Flush(mpsc::Sender<()>),
|
||||||
AddLocks(i64),
|
AddLocks(i64),
|
||||||
SetDisabled(bool),
|
SetDisabled(bool),
|
||||||
StopTracking,
|
StopTracking,
|
||||||
Exited,
|
Exited,
|
||||||
|
Ctrlc,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -160,6 +170,9 @@ impl PluginGcState {
|
||||||
// Exit and stop the plugin
|
// Exit and stop the plugin
|
||||||
return Some(true);
|
return Some(true);
|
||||||
}
|
}
|
||||||
|
PluginGcMsg::Ctrlc => {
|
||||||
|
eprintln!("Ctrl-C received, plugin: `{}`", self.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,6 +178,9 @@ impl PersistentPlugin {
|
||||||
|
|
||||||
// Start the plugin garbage collector
|
// Start the plugin garbage collector
|
||||||
let gc = PluginGc::new(mutable.gc_config.clone(), &self)?;
|
let gc = PluginGc::new(mutable.gc_config.clone(), &self)?;
|
||||||
|
// I need the current EngineState here
|
||||||
|
eprintln!("gc.sender: {:?}", gc.clone_sender());
|
||||||
|
|
||||||
|
|
||||||
let pid = child.id();
|
let pid = child.id();
|
||||||
let interface = make_plugin_interface(
|
let interface = make_plugin_interface(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user