Settle with promise, or reject with onTimeout()'s value once timeoutMs
elapses first. The timer is cleared as soon as promise settles. A
timeoutMs of <= 0 or a non-finite one installs no timer at all and
returns promise itself (the convention every timeout knob here follows).
The race only settles the CALLER: whatever promise stands for keeps
running. Callers that hold a resource for the work's duration release it
when the work settles, not when the race does.
Settle with
promise, or reject withonTimeout()'s value oncetimeoutMselapses first. The timer is cleared as soon aspromisesettles. AtimeoutMsof<= 0or a non-finite one installs no timer at all and returnspromiseitself (the convention every timeout knob here follows).The race only settles the CALLER: whatever
promisestands for keeps running. Callers that hold a resource for the work's duration release it when the work settles, not when the race does.