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

Method run

packages/socket.io/lib/index.ts:383–401  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

381 const keysIterator = this.parentNsps.keys();
382
383 const run = () => {
384 const nextFn = keysIterator.next();
385 if (nextFn.done) {
386 return fn(false);
387 }
388 nextFn.value(name, auth, (err, allow) => {
389 if (err || !allow) {
390 return run();
391 }
392 if (this._nsps.has(name)) {
393 // the namespace was created in the meantime
394 debug("dynamic namespace %s already exists", name);
395 return fn(this._nsps.get(name) as Namespace);
396 }
397 const namespace = this.parentNsps.get(nextFn.value)!.createChild(name);
398 debug("dynamic namespace %s was created", name);
399 fn(namespace);
400 });
401 };
402
403 run();
404 }

Callers 3

index.jsFile · 0.45
index.jsFile · 0.45
runFunction · 0.45

Calls 4

fnFunction · 0.85
runFunction · 0.85
debugFunction · 0.85
createChildMethod · 0.80

Tested by

no test coverage detected