plugin: parallel release fetches, faster shutdown, uninstall runner stop

- Run Plugin Manager release fetches on OS threads so they execute in

  parallel instead of serialising on the async executor.

- Reduce V4Connection shutdown poll from 3s to 100ms; the runner is killed

  and reaped without blocking host shutdown.

- Add PluginManager::remove and PluginProcess::shutdown_and_wait so

  uninstall can stop the runner before deleting files, fixing Windows

  access-denied errors on plugin removal.

- Rebuild ribbon immediately after uninstall so the tab disappears.
This commit is contained in:
Sebastian committed 2026-08-14 20:18:59 +02:00
1 parent 285d35182c
commit 83d7a4d7db
6 files changed
+75 -7

No files matched your search

+14 -1
View File
@@ -267,7 +267,7 @@ fn parse_string_array(s: &str) -> Vec<String> {
pub(crate) use loader::{shutdown_plugins, with_manager};
#[cfg(all(not(target_arch = "wasm32"), not(test)))]
pub(crate) use loader::{load_at_startup, loaded_ids};
pub(crate) use loader::{load_at_startup, loaded_ids, remove_plugin};
#[cfg(not(target_arch = "wasm32"))]
#[cfg_attr(test, allow(dead_code))]
@@ -342,6 +342,19 @@ mod loader {
});
}
/// Shut down the loaded plugin with `id` and remove it from the manager so
/// its files can be deleted on Windows. Returns true if the plugin was
/// loaded and has been removed.
pub fn remove_plugin(id: &str) -> bool {
MANAGER.with(|m| {
if let Some(manager) = m.borrow_mut().as_mut() {
manager.remove(id)
} else {
false
}
})
}
/// Path to the native library beside `plugin.toml`, if any.
fn lib_file(dir: &Path) -> Option<PathBuf> {
let ext = lib_extension();