If there are any cycles of dependencies (task-a depends on task-b which depends
on task-a), then taskGraphRunner will error unless force: true is passed:
let results = taskGraphRunner({ graph, task, force: true });
Graph cycles are resolved by picking a single item from the graph which has yet
to be run that has:
The fewest number of remaining dependencies (to reduce risk of missing dependencies)
The highest number of remaining dependents (to increase chance of unblocking dependents)
This function gets called on every item in the graph. It should return a
promise.
opts.task = async function task(item) { // ...};
opts.force (default false)
taskGraphRunner will error if it detects a cycle unless opts.force is
true in which case it will try to break cycles by choosing a remaining item
in the graph.
If it does detect a cycle, it will cause res.safe to be false.
res.values
This is a map of the items in the graph to their results from opts.task.