MCPcopy
hub / github.com/socketio/socket.io / callback

Function callback

packages/socket.io-adapter/lib/cluster-adapter.ts:316–330  ·  packages/socket.io-adapter/lib/cluster-adapter.ts::callback
(arg: any)

Source from the content-addressed store, hash-verified

314 }
315 let called = false;
316 const callback = (arg: any) => {
317 class="cm">// only one argument is expected
318 if (called) {
319 return;
320 }
321 called = true;
322 debug(class="st">"[%s] calling acknowledgement with %j", this.uid, arg);
323 this.publishResponse(message.uid, {
324 type: MessageType.SERVER_SIDE_EMIT_RESPONSE,
325 data: {
326 requestId: message.data.requestId,
327 packet: arg,
328 },
329 });
330 };
331
332 this.nsp._onServerSideEmit([...packet, callback]);
333 break;

Callers 2

applyMethod · 0.70
createServerFunction · 0.50

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected