improve scheduler to block works that take resouces from waiting higher priority job

If there is another worker with higher priority job is waiting for a resource
to run that job, the current worker should not get it.

For all the tasks pending under this worker, pick the one that does not block
higher priority job, with sufficent resouces, and has highest priority.

Algo: sort all works by priority, and number of dependents, then iterate over
them, fill them into worker as if those workers asks works too. Then the best
work is the one filled into current worker.