Concurrency Coordination Reports
Promise All Coordination Report
Join a deterministic set of resolved task values with Promise.all and label the coordination outcome.
Promise All Coordination Report
promise_all_coordination.js
const taskCount = 3;
let joined = 0;
let outcome = "partial";
async function coordinate(count) {
const tasks = Array.from({ length: count }, (_, i) => Promise.resolve(i + 1));
const values = await Promise.all(tasks);
joined = values.reduce((sum, v) => sum + v, 0);
if (joined >= 10) {
outcome = "full";
} else if (joined >= 3) {
outcome = "quorum";
}
console.log(`tasks=${count} joined=${joined} status=${outcome}`);
}
coordinate(taskCount);
promise join
A Promise.all join awaits every task value before deriving one scalar status, so the report stays deterministic.