MCPcopy Create free account
hub / github.com/sindresorhus/execa / waitForConcurrentStreams

Function waitForConcurrentStreams

lib/convert/concurrent.js:26–33  ·  view source on GitHub ↗
({resolve, promises}, subprocess)

Source from the content-addressed store, hash-verified

24
25// Wait for other streams, but stop waiting when subprocess ends
26export const waitForConcurrentStreams = async ({resolve, promises}, subprocess) => {
27 resolve();
28 const [isSubprocessExit] = await Promise.race([
29 Promise.allSettled([true, subprocess]),
30 Promise.all([false, ...promises]),
31 ]);
32 return !isSubprocessExit;
33};

Callers 3

onWritableFinalFunction · 0.90
onWritableDestroyFunction · 0.90
onReadableDestroyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected