change: Restructure project
This commit is contained in:
parent
3aa5ff0ef6
commit
b6fa67a7a1
83
Cargo.toml
83
Cargo.toml
|
@ -2,7 +2,7 @@
|
|||
# The `pueue_lib` crate lives in the `lib` folder.
|
||||
# The following is the shared configuration for both pueue and its lib
|
||||
[workspace]
|
||||
members = ["lib"]
|
||||
members = ["pueue_lib", "pueue"]
|
||||
|
||||
[workspace.package]
|
||||
authors = ["Arne Beer <contact@arne.beer>"]
|
||||
|
@ -22,86 +22,5 @@ serde_derive = "1.0"
|
|||
snap = "1.1"
|
||||
tokio = { version = "1.23", features = ["rt-multi-thread", "time", "io-std"] }
|
||||
|
||||
|
||||
# ------------------------
|
||||
# Start of the actual "pueue" config.
|
||||
# ------------------------
|
||||
[package]
|
||||
name = "pueue"
|
||||
version = "3.0.1"
|
||||
description = "A cli tool for managing long running shell commands."
|
||||
keywords = ["shell", "command", "parallel", "task", "queue"]
|
||||
readme = "README.md"
|
||||
authors.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "actively-developed" }
|
||||
|
||||
[[bin]]
|
||||
name = "pueue"
|
||||
path = "client/main.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "pueued"
|
||||
path = "daemon/main.rs"
|
||||
|
||||
# Split the daemon logic in a lib and bin crate.
|
||||
# Using a lib allows us to do proper integration testing.
|
||||
[lib]
|
||||
name = "pueue_daemon_lib"
|
||||
path = "daemon/lib.rs"
|
||||
|
||||
[profile.release]
|
||||
lto = "thin"
|
||||
|
||||
[dependencies]
|
||||
pueue-lib = { version = "0.21.0", path = "lib" }
|
||||
|
||||
anyhow = "1.0"
|
||||
chrono-english = "0.1"
|
||||
clap = { version = "4.0", features = ["derive", "cargo"] }
|
||||
clap_complete = "4.0"
|
||||
comfy-table = "6.1"
|
||||
crossbeam-channel = "0.5"
|
||||
crossterm = { version = "0.25", default-features = false }
|
||||
ctrlc = { version = "3", features = ["termination"] }
|
||||
handlebars = "4.3"
|
||||
pest = "2.5"
|
||||
pest_derive = "2.5"
|
||||
shell-escape = "0.1"
|
||||
simplelog = "0.12"
|
||||
tempfile = "3.3"
|
||||
|
||||
chrono = { workspace = true }
|
||||
command-group = { workspace = true }
|
||||
log = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
serde_derive = { workspace = true }
|
||||
snap = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd = "2"
|
||||
better-panic = "0.3"
|
||||
pretty_assertions = "1"
|
||||
rstest = "0.16"
|
||||
serde_yaml = "0.9"
|
||||
similar-asserts = "1"
|
||||
|
||||
# Make it easy to view log output for select tests.
|
||||
# Set log level for tests with RUST_LOG=<level>, use with failed tests or
|
||||
# disable test stdout/stderr capture (`cargo test -- --nocapture` / `cargo
|
||||
# nextest run --no-capture`)
|
||||
env_logger = "0.10"
|
||||
test-log = "0.2"
|
||||
|
||||
# Test specific dev-dependencies
|
||||
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
|
||||
whoami = "1"
|
||||
procfs = { version = "0.14", default-features = false }
|
||||
|
|
|
@ -97,7 +97,7 @@ It might compile on older versions, but this isn't tested or officially supporte
|
|||
```bash
|
||||
git clone git@github.com:Nukesor/pueue
|
||||
cd pueue
|
||||
cargo build --release --locked --path .
|
||||
cargo build --release --locked --path ./pueue
|
||||
```
|
||||
|
||||
The final binaries will be located in `target/release/{pueue,pueued}`.
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
[package]
|
||||
name = "pueue"
|
||||
version = "3.0.1"
|
||||
description = "A cli tool for managing long running shell commands."
|
||||
keywords = ["shell", "command", "parallel", "task", "queue"]
|
||||
readme = "README.md"
|
||||
authors.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "actively-developed" }
|
||||
|
||||
[dependencies]
|
||||
pueue-lib = { version = "0.21.0", path = "../pueue_lib" }
|
||||
|
||||
anyhow = "1.0"
|
||||
chrono-english = "0.1"
|
||||
clap = { version = "4.0", features = ["derive", "cargo"] }
|
||||
clap_complete = "4.0"
|
||||
comfy-table = "6.1"
|
||||
crossbeam-channel = "0.5"
|
||||
crossterm = { version = "0.25", default-features = false }
|
||||
ctrlc = { version = "3", features = ["termination"] }
|
||||
handlebars = "4.3"
|
||||
pest = "2.5"
|
||||
pest_derive = "2.5"
|
||||
shell-escape = "0.1"
|
||||
simplelog = "0.12"
|
||||
tempfile = "3.3"
|
||||
|
||||
chrono = { workspace = true }
|
||||
command-group = { workspace = true }
|
||||
log = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
serde_derive = { workspace = true }
|
||||
snap = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd = "2"
|
||||
better-panic = "0.3"
|
||||
pretty_assertions = "1"
|
||||
rstest = "0.16"
|
||||
serde_yaml = "0.9"
|
||||
similar-asserts = "1"
|
||||
|
||||
# Make it easy to view log output for select tests.
|
||||
# Set log level for tests with RUST_LOG=<level>, use with failed tests or
|
||||
# disable test stdout/stderr capture (`cargo test -- --nocapture` / `cargo
|
||||
# nextest run --no-capture`)
|
||||
env_logger = "0.10"
|
||||
test-log = "0.2"
|
||||
|
||||
# Test specific dev-dependencies
|
||||
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
|
||||
whoami = "1"
|
||||
procfs = { version = "0.14", default-features = false }
|
|
@ -8,14 +8,8 @@ use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger};
|
|||
|
||||
use pueue_lib::settings::Settings;
|
||||
|
||||
mod cli;
|
||||
mod client;
|
||||
mod commands;
|
||||
pub(crate) mod display;
|
||||
mod query;
|
||||
|
||||
use crate::cli::{CliArguments, Shell, SubCommand};
|
||||
use crate::client::Client;
|
||||
use pueue::client::cli::{CliArguments, Shell, SubCommand};
|
||||
use pueue::client::client::Client;
|
||||
|
||||
/// This is the main entry point of the client.
|
||||
///
|
|
@ -5,8 +5,8 @@ use clap::Parser;
|
|||
use log::warn;
|
||||
use simplelog::{Config, ConfigBuilder, LevelFilter, SimpleLogger};
|
||||
|
||||
use pueue_daemon_lib::cli::CliArguments;
|
||||
use pueue_daemon_lib::run;
|
||||
use pueue::daemon::cli::CliArguments;
|
||||
use pueue::daemon::run;
|
||||
|
||||
#[tokio::main(flavor = "multi_thread", worker_threads = 4)]
|
||||
async fn main() -> Result<()> {
|
|
@ -13,9 +13,9 @@ use pueue_lib::network::secret::read_shared_secret;
|
|||
use pueue_lib::settings::Settings;
|
||||
use pueue_lib::state::PUEUE_DEFAULT_GROUP;
|
||||
|
||||
use crate::cli::{CliArguments, ColorChoice, GroupCommand, SubCommand};
|
||||
use crate::commands::*;
|
||||
use crate::display::*;
|
||||
use crate::client::cli::{CliArguments, ColorChoice, GroupCommand, SubCommand};
|
||||
use crate::client::commands::*;
|
||||
use crate::client::display::*;
|
||||
|
||||
/// This struct contains the base logic for the client.
|
||||
/// The client is responsible for connecting to the daemon, sending instructions
|
|
@ -7,7 +7,7 @@ use anyhow::{Context, Result};
|
|||
|
||||
use pueue_lib::{network::protocol::GenericStream, settings::Settings, task::Task};
|
||||
|
||||
use crate::{
|
||||
use crate::client::{
|
||||
cli::SubCommand,
|
||||
display::{print_state, OutputStyle},
|
||||
};
|
|
@ -4,8 +4,8 @@ use anyhow::{bail, Result};
|
|||
|
||||
use pueue_lib::network::protocol::GenericStream;
|
||||
|
||||
use crate::commands::get_state;
|
||||
use crate::display::follow_local_task_logs;
|
||||
use crate::client::commands::get_state;
|
||||
use crate::client::display::follow_local_task_logs;
|
||||
|
||||
/// This function reads a log file from the filesystem and streams it to `stdout`.
|
||||
/// This is the default behavior of `pueue`'s log reading logic, which is only possible
|
|
@ -4,8 +4,8 @@ use pueue_lib::network::message::*;
|
|||
use pueue_lib::network::protocol::*;
|
||||
use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
||||
|
||||
use crate::commands::edit::edit_task_properties;
|
||||
use crate::commands::get_state;
|
||||
use crate::client::commands::edit::edit_task_properties;
|
||||
use crate::client::commands::get_state;
|
||||
|
||||
/// When restarting tasks, the remote state is queried and a [AddMessage]
|
||||
/// is create from the existing task in the state.
|
|
@ -9,7 +9,7 @@ use tokio::time::sleep;
|
|||
use pueue_lib::network::protocol::GenericStream;
|
||||
use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
||||
|
||||
use crate::{commands::get_state, display::OutputStyle};
|
||||
use crate::client::{commands::get_state, display::OutputStyle};
|
||||
|
||||
/// Wait until tasks are done.
|
||||
/// Tasks can be specified by:
|
|
@ -10,7 +10,7 @@ use pueue_lib::{
|
|||
network::protocol::GenericStream,
|
||||
};
|
||||
|
||||
use crate::commands::get_state;
|
||||
use crate::client::commands::get_state;
|
||||
|
||||
/// Follow the log ouput of running task.
|
||||
///
|
|
@ -6,7 +6,7 @@ use comfy_table::*;
|
|||
use pueue_lib::log::{get_log_file_handle, seek_to_last_lines};
|
||||
use pueue_lib::settings::Settings;
|
||||
|
||||
use crate::display::OutputStyle;
|
||||
use crate::client::display::OutputStyle;
|
||||
|
||||
/// The daemon didn't send any log output, thereby we didn't request any.
|
||||
/// If that's the case, read the log file from the local pueue directory.
|
|
@ -7,7 +7,7 @@ use pueue_lib::settings::Settings;
|
|||
use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
||||
|
||||
use super::OutputStyle;
|
||||
use crate::cli::SubCommand;
|
||||
use crate::client::cli::SubCommand;
|
||||
|
||||
mod json;
|
||||
mod local;
|
|
@ -5,9 +5,9 @@ use pueue_lib::state::{State, PUEUE_DEFAULT_GROUP};
|
|||
use pueue_lib::task::Task;
|
||||
|
||||
use super::{helper::*, table_builder::TableBuilder, OutputStyle};
|
||||
use crate::cli::SubCommand;
|
||||
use crate::display::group::get_group_headline;
|
||||
use crate::query::apply_query;
|
||||
use crate::client::cli::SubCommand;
|
||||
use crate::client::display::group::get_group_headline;
|
||||
use crate::client::query::apply_query;
|
||||
|
||||
/// Print the current state of the daemon in a nicely formatted table.
|
||||
/// If there are multiple groups, each group with a task will have its own table.
|
|
@ -7,7 +7,7 @@ use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
|||
|
||||
use super::helper::{formatted_start_end, start_of_today};
|
||||
use super::OutputStyle;
|
||||
use crate::query::Rule;
|
||||
use crate::client::query::Rule;
|
||||
|
||||
/// This builder is responsible for determining which table columns should be displayed and
|
||||
/// building a full [comfy_table] from a list of given [Task]s.
|
||||
|
@ -103,7 +103,7 @@ impl<'a> TableBuilder<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Take a list of given [pest] rules from our `crate::query::column_selection::apply` logic.
|
||||
/// Take a list of given [pest] rules from our `crate::client::query::column_selection::apply` logic.
|
||||
/// Set the column visibility based on these rules.
|
||||
pub fn set_visibility_by_rules(&mut self, rules: &[Rule]) {
|
||||
// Don't change anything, if there're no rules
|
|
@ -0,0 +1,5 @@
|
|||
pub mod cli;
|
||||
pub mod client;
|
||||
mod commands;
|
||||
pub(crate) mod display;
|
||||
mod query;
|
|
@ -13,7 +13,7 @@ use limit::Limit;
|
|||
use order_by::Direction;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[grammar = "./client/query/syntax.pest"]
|
||||
#[grammar = "./src/client/query/syntax.pest"]
|
||||
struct QueryParser;
|
||||
|
||||
type FilterFunction = dyn Fn(&Task) -> bool;
|
|
@ -15,8 +15,8 @@ use pueue_lib::settings::Settings;
|
|||
use pueue_lib::state::State;
|
||||
|
||||
use self::state_helper::{restore_state, save_state};
|
||||
use crate::network::socket::accept_incoming;
|
||||
use crate::task_handler::{TaskHandler, TaskSender};
|
||||
use crate::daemon::network::socket::accept_incoming;
|
||||
use crate::daemon::task_handler::{TaskHandler, TaskSender};
|
||||
|
||||
pub mod cli;
|
||||
mod network;
|
|
@ -5,8 +5,8 @@ use pueue_lib::state::{GroupStatus, SharedState};
|
|||
use pueue_lib::task::{Task, TaskStatus};
|
||||
|
||||
use super::*;
|
||||
use crate::daemon::state_helper::save_state;
|
||||
use crate::ok_or_return_failure_message;
|
||||
use crate::state_helper::save_state;
|
||||
|
||||
/// Invoked when calling `pueue add`.
|
||||
/// Queues a new task to the state.
|
|
@ -4,8 +4,8 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::{TaskResult, TaskStatus};
|
||||
|
||||
use super::*;
|
||||
use crate::daemon::state_helper::{is_task_removable, save_state};
|
||||
use crate::ok_or_return_failure_message;
|
||||
use crate::state_helper::{is_task_removable, save_state};
|
||||
|
||||
fn construct_success_clean_message(message: CleanMessage) -> String {
|
||||
let successfull_only_fix = if message.successful_only {
|
|
@ -4,8 +4,8 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use super::*;
|
||||
use crate::daemon::state_helper::save_state;
|
||||
use crate::ok_or_return_failure_message;
|
||||
use crate::state_helper::save_state;
|
||||
|
||||
/// Invoked when calling `pueue edit`.
|
||||
/// If a user wants to edit a message, we need to send him the current command.
|
|
@ -3,7 +3,7 @@ use pueue_lib::network::message::*;
|
|||
use pueue_lib::state::SharedState;
|
||||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
/// Invoked when calling `pueue enqueue`.
|
||||
/// Enqueue specific stashed tasks.
|
|
@ -2,8 +2,8 @@ use pueue_lib::network::message::*;
|
|||
use pueue_lib::state::{SharedState, PUEUE_DEFAULT_GROUP};
|
||||
|
||||
use super::TaskSender;
|
||||
use crate::network::message_handler::ok_or_failure_message;
|
||||
use crate::network::response_helper::ensure_group_exists;
|
||||
use crate::daemon::network::message_handler::ok_or_failure_message;
|
||||
use crate::daemon::network::response_helper::ensure_group_exists;
|
||||
use crate::ok_or_return_failure_message;
|
||||
|
||||
/// Invoked on `pueue groups`.
|
|
@ -2,7 +2,7 @@ use pueue_lib::network::message::*;
|
|||
use pueue_lib::state::SharedState;
|
||||
|
||||
use super::{TaskSender, SENDER_ERR};
|
||||
use crate::network::response_helper::{ensure_group_exists, task_action_response_helper};
|
||||
use crate::daemon::network::response_helper::{ensure_group_exists, task_action_response_helper};
|
||||
|
||||
/// Invoked when calling `pueue kill`.
|
||||
/// Forward the kill message to the task handler, which then kills the process.
|
|
@ -5,7 +5,7 @@ use pueue_lib::settings::Settings;
|
|||
use pueue_lib::state::SharedState;
|
||||
|
||||
use super::TaskSender;
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
mod add;
|
||||
mod clean;
|
||||
|
@ -104,7 +104,7 @@ mod fixtures {
|
|||
pub use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
||||
|
||||
pub use super::*;
|
||||
pub use crate::network::response_helper::*;
|
||||
pub use crate::daemon::network::response_helper::*;
|
||||
|
||||
pub fn get_settings() -> (Settings, TempDir) {
|
||||
let tempdir = TempDir::new().expect("Failed to create test pueue directory");
|
|
@ -1,7 +1,7 @@
|
|||
use pueue_lib::network::message::*;
|
||||
use pueue_lib::state::SharedState;
|
||||
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
/// Set the parallel tasks for a specific group.
|
||||
pub fn set_parallel_tasks(message: ParallelMessage, state: &SharedState) -> Message {
|
|
@ -3,7 +3,7 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use super::{TaskSender, SENDER_ERR};
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
/// Invoked when calling `pueue pause`.
|
||||
/// Forward the pause message to the task handler, which then pauses groups/tasks/everything.
|
|
@ -5,9 +5,9 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::{Task, TaskStatus};
|
||||
|
||||
use super::ok_or_failure_message;
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
use crate::daemon::state_helper::{is_task_removable, save_state};
|
||||
use crate::ok_or_return_failure_message;
|
||||
use crate::state_helper::{is_task_removable, save_state};
|
||||
|
||||
/// Invoked when calling `pueue remove`.
|
||||
/// Remove tasks from the queue.
|
|
@ -3,7 +3,7 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use super::{TaskSender, SENDER_ERR};
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
/// Invoked when calling `pueue start`.
|
||||
/// Forward the start message to the task handler, which then starts the process(es).
|
|
@ -2,7 +2,7 @@ use pueue_lib::network::message::*;
|
|||
use pueue_lib::state::SharedState;
|
||||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use crate::network::response_helper::*;
|
||||
use crate::daemon::network::response_helper::*;
|
||||
|
||||
/// Invoked when calling `pueue stash`.
|
||||
/// Stash specific queued tasks.
|
|
@ -4,8 +4,8 @@ use pueue_lib::state::SharedState;
|
|||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use super::ok_or_failure_message;
|
||||
use crate::daemon::state_helper::save_state;
|
||||
use crate::ok_or_return_failure_message;
|
||||
use crate::state_helper::save_state;
|
||||
|
||||
/// Invoked when calling `pueue switch`.
|
||||
/// Switch the position of two tasks in the upcoming queue.
|
|
@ -4,7 +4,7 @@ use pueue_lib::network::message::{create_failure_message, create_success_message
|
|||
use pueue_lib::state::{Group, State};
|
||||
use pueue_lib::task::Task;
|
||||
|
||||
use crate::state_helper::LockedState;
|
||||
use crate::daemon::state_helper::LockedState;
|
||||
|
||||
/// Check whether the given group exists. Return an failure message if it doesn't.
|
||||
pub fn ensure_group_exists<'state>(
|
|
@ -12,9 +12,9 @@ use pueue_lib::network::secret::read_shared_secret;
|
|||
use pueue_lib::settings::Settings;
|
||||
use pueue_lib::state::SharedState;
|
||||
|
||||
use crate::network::follow_log::handle_follow;
|
||||
use crate::network::message_handler::{handle_message, SENDER_ERR};
|
||||
use crate::task_handler::TaskSender;
|
||||
use crate::daemon::network::follow_log::handle_follow;
|
||||
use crate::daemon::network::message_handler::{handle_message, SENDER_ERR};
|
||||
use crate::daemon::task_handler::TaskSender;
|
||||
|
||||
/// Poll the listener and accept new incoming connections.
|
||||
/// Create a new future to handle the message and spawn it.
|
|
@ -2,8 +2,8 @@ use anyhow::Context;
|
|||
|
||||
use super::*;
|
||||
|
||||
use crate::daemon::state_helper::{pause_on_failure, save_state};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::{pause_on_failure, save_state};
|
||||
|
||||
impl TaskHandler {
|
||||
/// Check whether there are any finished processes
|
|
@ -4,9 +4,9 @@ use log::{error, info};
|
|||
|
||||
use pueue_lib::network::message::GroupMessage;
|
||||
|
||||
use crate::daemon::state_helper::save_state;
|
||||
use crate::daemon::task_handler::{Shutdown, TaskHandler};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::save_state;
|
||||
use crate::task_handler::{Shutdown, TaskHandler};
|
||||
|
||||
impl TaskHandler {
|
||||
/// Handle the addition and the removal of groups.
|
|
@ -5,9 +5,9 @@ use pueue_lib::process_helper::*;
|
|||
use pueue_lib::state::GroupStatus;
|
||||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use crate::daemon::state_helper::save_state;
|
||||
use crate::daemon::task_handler::{Shutdown, TaskHandler};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::save_state;
|
||||
use crate::task_handler::{Shutdown, TaskHandler};
|
||||
|
||||
impl TaskHandler {
|
||||
/// Kill specific tasks or groups.
|
|
@ -4,7 +4,7 @@ use log::warn;
|
|||
|
||||
use pueue_lib::network::message::*;
|
||||
|
||||
use crate::task_handler::TaskHandler;
|
||||
use crate::daemon::task_handler::TaskHandler;
|
||||
|
||||
mod group;
|
||||
mod kill;
|
|
@ -4,9 +4,9 @@ use pueue_lib::network::message::TaskSelection;
|
|||
use pueue_lib::state::GroupStatus;
|
||||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use crate::daemon::state_helper::{save_state, LockedState};
|
||||
use crate::daemon::task_handler::{ProcessAction, Shutdown, TaskHandler};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::{save_state, LockedState};
|
||||
use crate::task_handler::{ProcessAction, Shutdown, TaskHandler};
|
||||
|
||||
impl TaskHandler {
|
||||
/// Pause specific tasks or groups.
|
|
@ -2,7 +2,7 @@ use std::io::Write;
|
|||
|
||||
use log::{error, warn};
|
||||
|
||||
use crate::task_handler::TaskHandler;
|
||||
use crate::daemon::task_handler::TaskHandler;
|
||||
|
||||
impl TaskHandler {
|
||||
/// Send some input to a child process' stdin.
|
|
@ -4,9 +4,9 @@ use pueue_lib::network::message::TaskSelection;
|
|||
use pueue_lib::state::GroupStatus;
|
||||
use pueue_lib::task::TaskStatus;
|
||||
|
||||
use crate::daemon::state_helper::{save_state, LockedState};
|
||||
use crate::daemon::task_handler::{ProcessAction, Shutdown, TaskHandler};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::{save_state, LockedState};
|
||||
use crate::task_handler::{ProcessAction, Shutdown, TaskHandler};
|
||||
|
||||
impl TaskHandler {
|
||||
/// Start specific tasks or groups.
|
|
@ -18,8 +18,8 @@ use pueue_lib::settings::Settings;
|
|||
use pueue_lib::state::{GroupStatus, SharedState};
|
||||
use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
||||
|
||||
use crate::pid::cleanup_pid_file;
|
||||
use crate::state_helper::{reset_state, save_state};
|
||||
use crate::daemon::pid::cleanup_pid_file;
|
||||
use crate::daemon::state_helper::{reset_state, save_state};
|
||||
|
||||
mod callback;
|
||||
/// A helper newtype struct, which implements convenience methods for our child process management
|
|
@ -1,7 +1,7 @@
|
|||
use super::*;
|
||||
|
||||
use crate::daemon::state_helper::{pause_on_failure, save_state, LockedState};
|
||||
use crate::ok_or_shutdown;
|
||||
use crate::state_helper::{pause_on_failure, save_state, LockedState};
|
||||
|
||||
impl TaskHandler {
|
||||
/// See if we can start a new queued task.
|
|
@ -0,0 +1,2 @@
|
|||
pub mod client;
|
||||
pub mod daemon;
|
|
@ -3,7 +3,7 @@ use std::env::temp_dir;
|
|||
|
||||
use anyhow::Result;
|
||||
use chrono::{Duration, Local};
|
||||
use pueue_daemon_lib::state_helper::save_state;
|
||||
use pueue::daemon::state_helper::save_state;
|
||||
|
||||
use pueue_lib::state::{State, PUEUE_DEFAULT_GROUP};
|
||||
use pueue_lib::task::{Task, TaskResult, TaskStatus};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue