wip
This commit is contained in:
parent
62ea26d933
commit
a36069519f
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user