MCPcopy Index your code
hub / github.com/nodejs/node / post

Method post

test/parallel/test-worker-debug.js:112–126  ·  view source on GitHub ↗
(method, parameters)

Source from the content-addressed store, hash-verified

110 }
111
112 post(method, parameters) {
113 const msg = {
114 id: this._nextCommandId++,
115 method
116 };
117 if (parameters)
118 msg.params = parameters;
119
120 return new Promise((resolve, reject) => {
121 this._requestCallbacks.set(msg.id, [resolve, reject]);
122 this._parentSession.post('NodeWorker.sendMessageToWorker', {
123 sessionId: this._id, message: JSON.stringify(msg)
124 });
125 });
126 }
127}
128
129async function testBasicWorkerDebug(session, post) {

Calls 1

setMethod · 0.45

Tested by 1

testFunction · 0.36