For each async task, I want to attach to it
overall_priority = (priority: u64, millis_idle_for: u64), and whenever there is more than one task available, have it pick the one with highest overall_priority.
Context: Rust / wasm32. I have a bunch of async tasks on a thread, and seeing if there is a way to prioritize it (moving it off to another web worker would be quite a hassle due to shared state).
EDIT: the above construction is: if a single task has strict higher priority, pick it; of more than one task has highest priority, round robin (based on millis_idle_for).