mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 03:11:12 +01:00
Reload plugins on change
This commit is contained in:
@@ -15,6 +15,7 @@ use std::time::Duration;
|
||||
use tauri::{AppHandle, Runtime};
|
||||
use tokio::sync::mpsc;
|
||||
use tokio::sync::watch::Sender;
|
||||
use crate::handle::PluginHandle;
|
||||
|
||||
pub struct PluginManager {
|
||||
kill_tx: Sender<bool>,
|
||||
@@ -38,6 +39,10 @@ impl PluginManager {
|
||||
PluginManager { kill_tx, server }
|
||||
}
|
||||
|
||||
pub async fn reload_all(&self) {
|
||||
self.server.reload_plugins().await
|
||||
}
|
||||
|
||||
pub async fn subscribe(&self) -> (String, mpsc::Receiver<InternalEvent>) {
|
||||
self.server.subscribe().await
|
||||
}
|
||||
@@ -68,6 +73,10 @@ impl PluginManager {
|
||||
self.server.plugin_by_dir(dir).await.ok()?.info().await
|
||||
}
|
||||
|
||||
pub async fn get_plugin(&self, ref_id: &str) -> Result<PluginHandle> {
|
||||
self.server.plugin_by_ref_id(ref_id).await
|
||||
}
|
||||
|
||||
pub async fn get_http_request_actions(&self) -> Result<Vec<GetHttpRequestActionsResponse>> {
|
||||
let reply_events = self
|
||||
.server
|
||||
|
||||
Reference in New Issue
Block a user