-
Notifications
You must be signed in to change notification settings - Fork 3
Architecture
nick42d edited this page Dec 3, 2023
·
9 revisions
App has been designed for me to learn Rust, and therefore I have implemented the following constraints to learn some features. I am aware these may not be the most efficient ways to code.
- Avoid shared mutable state: The app will avoid shared mutable state primitives such as Mutex and RefCell and instead communicate via messaging.
- Concurrency over parralelism: Where possible, the app will use use an asynchronous mode of operation (such as futures::join! and tokio::select) over parallel equivalents such as tokio::spawn and thread::spawn.
- Avoid cloning: Where possible, the app will avoid cloning as a method to beat the borrow checker. Instead, we will try to safely borrow.
- Encode state into the type system: Where possible use the type system to represent actions that are not possible in the current state.
WIP
graph TD;
M[youtui::main]
Config
M-->Config-->CLI
Config-->TUI
CLI-->Error
TUI-->Error
Error
CLI
subgraph TUI
subgraph App
EventHandler-->TaskManager-->Server
EventHandler-->UI
TaskManager-->UI-->View
UI-->CallbackQueue-->TaskManager
CallbackQueue-->UI
end
end