This commit is contained in:
Andy Gayton 2024-06-20 20:47:35 -04:00
parent 62ea26d933
commit a36069519f
2 changed files with 17 additions and 1 deletions

View File

@ -85,16 +85,26 @@ impl PluginGc {
pub fn exited(&self) {
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)]
enum PluginGcMsg {
pub enum PluginGcMsg {
SetConfig(PluginGcConfig),
Flush(mpsc::Sender<()>),
AddLocks(i64),
SetDisabled(bool),
StopTracking,
Exited,
Ctrlc,
}
#[derive(Debug)]
@ -160,6 +170,9 @@ impl PluginGcState {
// Exit and stop the plugin
return Some(true);
}
PluginGcMsg::Ctrlc => {
eprintln!("Ctrl-C received, plugin: `{}`", self.name);
}
}
None
}

View File

@ -178,6 +178,9 @@ impl PersistentPlugin {
// Start the plugin garbage collector
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 interface = make_plugin_interface(