pub fn lease_next(
queue: &mut Vec<TaskProgress>,
in_flight: &InFlightSet,
worker: &str,
) -> Option<TaskProgress>Expand description
Lease the next task of queue to worker: stamp the attempt’s dispatch time (the lease clock
starts now — KNOWN_ISSUES D-27), record the worker as this attempt’s (D-26), and record it in
flight. A re-queued task whose late result already finished it is dropped instead (it is not
converted twice); the next one is tried. None once the queue is empty.