.. [no ci]

This commit is contained in:
sxyazi 2023-12-29 01:26:39 +08:00
parent 8e2d56461d
commit 53e6e1bc0a
No known key found for this signature in database
7 changed files with 19 additions and 15 deletions

View file

@ -2,6 +2,7 @@
mod blocker;
mod file;
mod plugin;
mod running;
mod scheduler;
mod task;

View file

@ -0,0 +1,5 @@
mod op;
mod plugin;
pub use op::*;
pub use plugin::*;

View file

@ -0,0 +1,10 @@
#[derive(Debug)]
pub enum PluginOp {
Entry(PluginOpEntry),
}
#[derive(Clone, Debug)]
pub struct PluginOpEntry {
pub id: usize,
pub name: String,
}

View file

@ -1,6 +1,7 @@
use anyhow::Result;
use tokio::sync::mpsc;
use super::{PluginOp, PluginOpEntry};
use crate::TaskProg;
pub struct Plugin {
@ -10,17 +11,6 @@ pub struct Plugin {
prog: mpsc::UnboundedSender<TaskProg>,
}
#[derive(Debug)]
pub enum PluginOp {
Entry(PluginOpEntry),
}
#[derive(Clone, Debug)]
pub struct PluginOpEntry {
pub id: usize,
pub name: String,
}
impl Plugin {
pub fn new(prog: mpsc::UnboundedSender<TaskProg>) -> Self {
let (tx, rx) = async_channel::unbounded();

View file

@ -7,7 +7,7 @@ use yazi_config::{open::Opener, plugin::PluginRule, TASKS};
use yazi_shared::{emit, event::Exec, fs::{unique_path, Url}, Layer, Throttle};
use super::{Running, TaskProg, TaskStage};
use crate::{file::{File, FileOpDelete, FileOpLink, FileOpPaste, FileOpTrash}, workers::{Plugin, PluginOpEntry, Preload, PreloadOpRule, PreloadOpSize, Process, ProcessOpOpen}, TaskKind, TaskOp};
use crate::{file::{File, FileOpDelete, FileOpLink, FileOpPaste, FileOpTrash}, plugin::{Plugin, PluginOpEntry}, workers::{Preload, PreloadOpRule, PreloadOpSize, Process, ProcessOpOpen}, TaskKind, TaskOp};
pub struct Scheduler {
pub file: Arc<File>,

View file

@ -61,7 +61,7 @@ impl From<&Task> for TaskSummary {
#[derive(Debug)]
pub enum TaskOp {
File(Box<crate::file::FileOp>),
Plugin(Box<crate::workers::PluginOp>),
Plugin(Box<crate::plugin::PluginOp>),
Preload(Box<crate::workers::PreloadOp>),
Process(Box<crate::workers::ProcessOp>),
}

View file

@ -1,7 +1,5 @@
mod plugin;
mod preload;
mod process;
pub use plugin::*;
pub use preload::*;
pub use process::*;