MCPcopy
hub / github.com/sindresorhus/execa / getOneMessageAsync

Function getOneMessageAsync

lib/ipc/get-one.js:29–46  ·  view source on GitHub ↗
({anyProcess, channel, isSubprocess, filter, reference})

Source from the content-addressed store, hash-verified

27};
28
29const getOneMessageAsync = async ({anyProcess, channel, isSubprocess, filter, reference}) => {
30 addReference(channel, reference);
31 const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);
32 const controller = new AbortController();
33 try {
34 return await Promise.race([
35 getMessage(ipcEmitter, filter, controller),
36 throwOnDisconnect(ipcEmitter, isSubprocess, controller),
37 throwOnStrictError(ipcEmitter, isSubprocess, controller),
38 ]);
39 } catch (error) {
40 disconnect(anyProcess);
41 throw error;
42 } finally {
43 controller.abort();
44 removeReference(channel, reference);
45 }
46};
47
48const getMessage = async (ipcEmitter, filter, {signal}) => {
49 if (filter === undefined) {

Callers 1

getOneMessageFunction · 0.85

Calls 7

addReferenceFunction · 0.90
getIpcEmitterFunction · 0.90
disconnectFunction · 0.90
removeReferenceFunction · 0.90
throwOnStrictErrorFunction · 0.85
getMessageFunction · 0.70
throwOnDisconnectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…