Skip to main content

Module scheduler

Module scheduler 

Source

Re-exportsΒ§

pub use break_stats::BreakStats;
pub use hotkeys::apply_hotkeys;
pub use pause::PauseState;
pub use settings::Settings;
pub use settings::MonitorPlacement;
pub use settings::UpdateChannel;
pub use tray_countdown::format_countdown;
pub use tray_countdown::TrayCountdownSnapshot;
pub use types::SuppressReason;
pub use types::BreakKind;
pub use types::LastBreakInfo;
pub use types::BreathPattern;
pub use types::BreathSounds;
pub use types::RoutineStep;
pub use commands::backup::*;
pub use commands::breaks::*;
pub use commands::chores::*;
pub use commands::content_pack::*;
pub use commands::hooks::*;
pub use commands::plugins::*;
pub use commands::profiles::*;
pub use commands::settings::*;
pub use commands::stats::*;
pub use routines::*;

ModulesΒ§

break_stats πŸ”’
chores πŸ”’
commands πŸ”’
content_pack πŸ”’
Local content packs (#155): a versioned, user-controlled bundle of break ideas (hint pools) and guided routines that the user imports/exports as a plain JSON file. No cloud, no remote registry β€” everything is a local file the user explicitly picks.
exports πŸ”’
Declarative export-adapter delivery (#156, slice 6b).
hotkeys πŸ”’
Native global hotkeys (#150).
idle πŸ”’
β€œSeconds since the last input” probing.
overlay πŸ”’
overlay_watchdog πŸ”’
Render-readiness watchdog for the break overlay (#196, #226).
pause πŸ”’
routines πŸ”’
Guided break routines + the routine engine (#152, #153).
run_loop πŸ”’
screen_time πŸ”’
session_lock πŸ”’
Cross-platform β€œis the user session locked?” probe.
settings πŸ”’
timers πŸ”’
tray_countdown πŸ”’
types πŸ”’

StructsΒ§

Scheduler
Live, mutable state for the break scheduler.

ConstantsΒ§

DETECTOR_EVAL_INTERVAL πŸ”’
How often the off-tick task re-evaluates installed detector plugins. Detectors gate breaks, which fire on the order of minutes, so a few seconds of latency on a context change is imperceptible while keeping the wasm work infrequent.

FunctionsΒ§

lock_current_break πŸ”’
Recover from poison rather than silently swallow or panic. If the current_break mutex was poisoned by a panicking writer, we still want to publish into the slot β€” losing the publish breaks tray countdown + cold-mount overlay invariants. The inner data is always valid (we never leave the slot in a half-written state between locks), so taking it back is safe.
persist_plugins
Atomically persist the installed-plugin registry. Called after every install / uninstall so a crash never loses the merge-and-track record.
persist_profiles
Snapshot the profile list + active name and atomically write them to disk. Called after every profile mutation (create / rename / delete / reorder / reset) so a crash never loses a change.
plugins_path_for πŸ”’
The plugin registry lives beside settings.json in the same config dir. Derived rather than threaded through Scheduler::new so adding it didn’t change the constructor signature.