refactor(#2949): the mutex holds the scheduler, not a wrapper
`QueueInner` existed to hold the scheduler *and* a per-node side map. The map is gone, so it was a struct around one field — and worse, a struct of a type `hive_jobq` cannot drive: the crate's run-loop seam takes `&Arc<Mutex<Scheduler<..>>>` specifically. So `JobQueue` now holds `Arc<Mutex<Sched>>` directly, where `Sched` is just `Scheduler<NodeKind, Resource>`. Its six methods become free functions over `&Sched`; all six are `DagView` projections, i.e. the code the endpoint rework is going to delete anyway, so this does not entrench them. This is the precondition for c0re calling `claim_next`, not that switch itself — `run_worker` still claims through `claim_ready`. Landing it separately keeps the type change reviewable on its own.
This commit is contained in:
parent
d1f1a361f0
commit
be1060e52f
2 changed files with 199 additions and 213 deletions
|
|
@ -117,7 +117,6 @@ fn settle_rebuild_tail(q: &JobQueue, agent: &str, expect_ok: bool) {
|
|||
fn declared_resources(q: &JobQueue, node_id: hive_jobq::NodeId) -> Vec<Resource> {
|
||||
let inner = q.lock();
|
||||
inner
|
||||
.sched
|
||||
.graph()
|
||||
.node(node_id)
|
||||
.expect("node exists")
|
||||
|
|
|
|||
Loading…
Reference in a new issue