MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / subscribe

Method subscribe

packages/server/test/services.test.ts:38–45  ·  view source on GitHub ↗
(c: WsConnection, sid: string)

Source from the content-addressed store, hash-verified

36
37 private readonly _bySession = new Map<string, Set<WsConnection>>();
38 subscribe(c: WsConnection, sid: string): void {
39 let set = this._bySession.get(sid);
40 if (!set) {
41 set = new Set();
42 this._bySession.set(sid, set);
43 }
44 set.add(c);
45 }
46 unsubscribe(c: WsConnection, sid: string): void {
47 this._bySession.get(sid)?.delete(c);
48 }

Callers 2

makeBrokerWithBusFunction · 0.95
makeQuestionBrokerFunction · 0.95

Calls 3

getMethod · 0.65
setMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected