MCPcopy
hub / github.com/partykit/partykit / join

Method join

packages/party.io/src/socket.io/lib/socket.ts:558–565  ·  view source on GitHub ↗

* Joins a room. * * @example * io.on("connection", (socket) => { * // join a single room * socket.join("room1"); * * // join multiple rooms * socket.join(["room1", "room2"]); * }); * * @param {String|Array} rooms - room or array of rooms * @return a Promis

(rooms: Room | Array<Room>)

Source from the content-addressed store, hash-verified

556 * @return a Promise or nothing, depending on the adapter
557 */
558 public join(rooms: Room | Array<Room>): Promise<void> | void {
559 getLogger("socket.io").debug(`[socket] join room ${rooms}`);
560
561 return this.adapter.addAll(
562 this.id,
563 new Set(Array.isArray(rooms) ? rooms : [rooms])
564 );
565 }
566
567 /**
568 * Leaves a room.

Callers 15

_onconnectMethod · 0.95
encodeFunction · 0.45
getLevelBulkDataFunction · 0.45
ensureYarnLockFunction · 0.45
initFunction · 0.45
index.tsxFile · 0.45
insertMethod · 0.45
findAllFilesFunction · 0.45
useAssetServerFunction · 0.45
runBuildFunction · 0.45
setupFunction · 0.45
getArrayKVOptionFunction · 0.45

Calls 2

getLoggerFunction · 0.90
addAllMethod · 0.80

Tested by

no test coverage detected