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

Method unsubscribe

packages/server-e2e/src/client.ts:426–438  ·  view source on GitHub ↗

Send `unsubscribe` and await its ack.

(sid: string)

Source from the content-addressed store, hash-verified

424
425 /** Send `unsubscribe` and await its ack. */
426 async unsubscribe(sid: string): Promise<void> {
427 const ws = this._requireWs();
428 if (!this._subscribed.has(sid)) return;
429 const id = `unsub-${ulid()}`;
430 const ack = await ws.sendAndAwaitAck(
431 { type: 'unsubscribe', id, payload: { session_ids: [sid] } },
432 this._controlAckTimeoutMs,
433 );
434 if (ack.code !== 0) {
435 throw new Error(`unsubscribe rejected (code=${ack.code}): ${ack.msg ?? 'no message'}`);
436 }
437 this._subscribed.delete(sid);
438 }
439
440 /** Close the socket. Idempotent. */
441 async close(): Promise<void> {

Callers

nothing calls this directly

Calls 5

_requireWsMethod · 0.95
ulidFunction · 0.85
sendAndAwaitAckMethod · 0.80
hasMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected