mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
.. [no ci]
This commit is contained in:
parent
8e2d56461d
commit
53e6e1bc0a
7 changed files with 19 additions and 15 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
mod blocker;
|
mod blocker;
|
||||||
mod file;
|
mod file;
|
||||||
|
mod plugin;
|
||||||
mod running;
|
mod running;
|
||||||
mod scheduler;
|
mod scheduler;
|
||||||
mod task;
|
mod task;
|
||||||
|
|
|
||||||
5
yazi-scheduler/src/plugin/mod.rs
Normal file
5
yazi-scheduler/src/plugin/mod.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
mod op;
|
||||||
|
mod plugin;
|
||||||
|
|
||||||
|
pub use op::*;
|
||||||
|
pub use plugin::*;
|
||||||
10
yazi-scheduler/src/plugin/op.rs
Normal file
10
yazi-scheduler/src/plugin/op.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum PluginOp {
|
||||||
|
Entry(PluginOpEntry),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct PluginOpEntry {
|
||||||
|
pub id: usize,
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
|
||||||
|
use super::{PluginOp, PluginOpEntry};
|
||||||
use crate::TaskProg;
|
use crate::TaskProg;
|
||||||
|
|
||||||
pub struct Plugin {
|
pub struct Plugin {
|
||||||
|
|
@ -10,17 +11,6 @@ pub struct Plugin {
|
||||||
prog: mpsc::UnboundedSender<TaskProg>,
|
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 {
|
impl Plugin {
|
||||||
pub fn new(prog: mpsc::UnboundedSender<TaskProg>) -> Self {
|
pub fn new(prog: mpsc::UnboundedSender<TaskProg>) -> Self {
|
||||||
let (tx, rx) = async_channel::unbounded();
|
let (tx, rx) = async_channel::unbounded();
|
||||||
|
|
@ -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 yazi_shared::{emit, event::Exec, fs::{unique_path, Url}, Layer, Throttle};
|
||||||
|
|
||||||
use super::{Running, TaskProg, TaskStage};
|
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 struct Scheduler {
|
||||||
pub file: Arc<File>,
|
pub file: Arc<File>,
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl From<&Task> for TaskSummary {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum TaskOp {
|
pub enum TaskOp {
|
||||||
File(Box<crate::file::FileOp>),
|
File(Box<crate::file::FileOp>),
|
||||||
Plugin(Box<crate::workers::PluginOp>),
|
Plugin(Box<crate::plugin::PluginOp>),
|
||||||
Preload(Box<crate::workers::PreloadOp>),
|
Preload(Box<crate::workers::PreloadOp>),
|
||||||
Process(Box<crate::workers::ProcessOp>),
|
Process(Box<crate::workers::ProcessOp>),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
mod plugin;
|
|
||||||
mod preload;
|
mod preload;
|
||||||
mod process;
|
mod process;
|
||||||
|
|
||||||
pub use plugin::*;
|
|
||||||
pub use preload::*;
|
pub use preload::*;
|
||||||
pub use process::*;
|
pub use process::*;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue