Skip to main content

Module active_run

Module active_run 

Source
Expand description

ActiveRun: tracks every tune run currently executing in a background task, so crate::routes::runs can cancel one specific run and graceful shutdown can cancel and wait for all in-flight runs to be restored before the process actually exits.

Multiple tune tasks are allowed. A short-lived exclusive reservation is still used for post-hoc PID writes/reverts, because those operations mutate a live loop directly and must not overlap a tune or another write/revert.

Structs§

ActiveRun
Cheap to clone (an Arc<Mutex<..>> underneath), matching crate::state::AppState’s own Clone requirement for axum’s State extractor.
RunAlreadyActive
Returned by ActiveRun::start or ActiveRun::reserve when an exclusive write/revert reservation is already held.