diff --git a/images/thread_model.png b/images/thread_model.png new file mode 100644 index 0000000..fcf5c79 Binary files /dev/null and b/images/thread_model.png differ diff --git a/src/README.md b/src/README.md index af7b67e..39fd30d 100644 --- a/src/README.md +++ b/src/README.md @@ -1,6 +1,7 @@ # Gupax source files * [Structure](#Structure) * [Bootstrap](#Bootstrap) +* [Thread Model](#Thread-Model) * [Disk](#Disk) * [Scale](#Scale) * [Naming Scheme](#naming-scheme) @@ -9,12 +10,12 @@ | File/Folder | Purpose | |--------------|---------| | constants.rs | General constants needed in Gupax -| command.rs | Code for executing/handling P2Pool/XMRig | disk.rs | Code for writing to disk: `state.toml/node.toml/pool.toml`; This holds the structs for the [State] | ferris.rs | Cute crab bytes | gupax.rs | `Gupax` tab | main.rs | `App/Tab/State` + misc data/functions | node.rs | Community node ping code for the `P2Pool` simple tab +| process.rs | Code for executing/handling P2Pool/XMRig | p2pool.rs | `P2Pool` tab | status.rs | `Status` tab | update.rs | Update code for the `Gupax` tab @@ -43,6 +44,9 @@ This is how Gupax works internally when starting up: - If `ask_before_quit` == `true`, ask before quitting - Kill processes, kill connections, exit +## Thread Model +![thread_model.png](https://github.com/hinto-janaiyo/gupax/blob/main/images/thread_model.png) + ## Disk Long-term state is saved onto the disk in the "OS data folder", using the [TOML](https://github.com/toml-lang/toml) format. If not found, default files will be created. Given a slightly corrupted state file, Gupax will attempt to merge it with a new default one. This will most likely happen if the internal data structure of `state.toml` is changed in the future (e.g removing an outdated setting). Merging silently in the background is a good non-interactive way to handle this. The node/pool database cannot be merged, and if given a corrupted file, Gupax will show an un-recoverable error screen. If Gupax can't read/write to disk at all, or if there are any other big issues, it will show an un-recoverable error screen. diff --git a/src/main.rs b/src/main.rs index 45864d5..c8513c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,7 @@ mod gupax; mod p2pool; mod xmrig; mod update; -mod command; +mod process; use {ferris::*,constants::*,node::*,disk::*,status::*,update::*,gupax::*}; //---------------------------------------------------------------------------------------------------- Struct + Impl diff --git a/src/p2pool.rs b/src/p2pool.rs index ab7f5e9..7c6dc04 100644 --- a/src/p2pool.rs +++ b/src/p2pool.rs @@ -20,7 +20,7 @@ use crate::{ constants::*, disk::*, node::*, - command::*, + process::*, }; use egui::{ TextEdit,SelectableLabel,ComboBox,Label,Button, @@ -45,7 +45,7 @@ egui::Frame::none() .show(ui, |ui| { let text_style = egui::TextStyle::Monospace; let row_height = ui.text_style_height(&text_style); - let total_rows = 10_000; + let total_rows = 700_000; let width = width-(SPACE*2.0); egui::ScrollArea::vertical().max_width(width).max_height(height*3.5).auto_shrink([false; 2]).show_rows(ui, row_height, total_rows, |ui, row_range| { let mut text = "".to_string(); diff --git a/src/command.rs b/src/process.rs similarity index 94% rename from src/command.rs rename to src/process.rs index ca271a9..8864c7f 100644 --- a/src/command.rs +++ b/src/process.rs @@ -62,7 +62,10 @@ impl Process { args, path, signal: ProcessSignal::None, - output: String::new(), + // P2Pool log level 1 produces a bit less than 100,000 lines a day. + // Assuming each line averages 80 UTF-8 scalars (80 bytes), then this + // initial buffer should last around a week (56MB) before resetting. + output: String::with_capacity(56_000_000), input: vec![String::new()], } }