Promise.all
only resolves when all promises resolve, rejects when the first promise rejectsPromise.allSettled
only resolves once all promises settlePromise.any
resolves only the first resolved promise, rejects when all the promises rejectPromise.race
settles with the same result of the first promise to settle
It seems that Promise
in Javascript does not have the equivalent of asyncio.as_completed
which yields Promises in the order they settle.
Is it possible to achieve the same logic of asyncio.as_completed
with user code?