any

fnFuture!T any(T)(Promise!T[] promises) @trusted

Resolve with the first successfully resolved future, or reject if all fail.

any waits for the first future in the array to resolve successfully. If a future rejects, it continues waiting for the others. Only when all futures have rejected or been cancelled does the returned future reject.

Parameters

promisesArray of promises whose futures are being raced.

Returns

A Future!T that resolves with the first successful value, or

rejects if every input fails.