Skip to main content

compute_ready_queue

Function compute_ready_queue 

Source
pub fn compute_ready_queue(
    mana_dir: &Path,
    filter_id: Option<&str>,
    simulate: bool,
) -> Result<ReadyQueue, Error>
Expand description

Compute which units are ready to dispatch.

Returns a ReadyQueue with units sorted by priority then critical-path weight (units blocking the most downstream work come first).

Optionally filters to a specific unit ID or its ready children if filter_id is a parent unit.

Set simulate = true to include all open units with verify commands, even those whose dependencies are not yet met. This is the dry-run mode.

§Errors

§Example

use mana_core::api::compute_ready_queue;
use std::path::Path;

let queue = compute_ready_queue(Path::new("/project/.mana"), None, false).unwrap();
for unit in &queue.units {
    println!("Ready: {} (weight={})", unit.id, unit.critical_path_weight);
}
println!("Blocked: {}", queue.blocked.len());