mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
Plugin init/dispose
This commit is contained in:
@@ -2,7 +2,6 @@ use crate::error::Result;
|
||||
use crate::events::{InternalEvent, InternalEventPayload, PluginWindowContext};
|
||||
use crate::plugin_meta::{PluginMetadata, get_plugin_meta};
|
||||
use crate::util::gen_id;
|
||||
use log::info;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::{Mutex, mpsc};
|
||||
@@ -58,13 +57,6 @@ impl PluginHandle {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn terminate(&self, window_context: &PluginWindowContext) -> Result<()> {
|
||||
info!("Terminating plugin {}", self.dir);
|
||||
let event =
|
||||
self.build_event_to_send(window_context, &InternalEventPayload::TerminateRequest, None);
|
||||
self.send(&event).await
|
||||
}
|
||||
|
||||
pub async fn send(&self, event: &InternalEvent) -> Result<()> {
|
||||
self.to_plugin_tx.lock().await.send(event.to_owned()).await?;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user