feat: Allow plugins to signal to deactivate themselves

Necessary when a plugin is unsupported
This commit is contained in:
Michael Aaron Murphy 2021-08-20 18:44:22 +02:00
parent 5ce96c624b
commit 6efad71f0e
3 changed files with 14 additions and 2 deletions

View file

@ -139,6 +139,12 @@ impl<O: Write> Service<O> {
gpu_preference,
});
}
// Report the plugin as finished and remove it from future polling
PluginResponse::Deactivate => {
self.finished(plugin).await;
let _ = self.plugins.remove(plugin);
}
},
// When a plugin has exited, the sender attached to the plugin will be dropped