MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / unsubscribe

Method unsubscribe

packages/event-service/src/client.ts:287–306  ·  view source on GitHub ↗
(contexts: string[])

Source from the content-addressed store, hash-verified

285 clearTimeout(this.reconnectTimer);
286 this.reconnectTimer = null;
287 }
288 this.clearHandshakeTimer();
289 // If a connect handshake is still in flight, reject it so callers
290 // awaiting connect() don't hang forever.
291 if (this.abortHandshake) {
292 this.abortHandshake(new Error('disconnected'));
293 }
294 if (this.ws) {
295 this.ws.close();
296 this.ws = null;
297 }
298 this.stopPing();
299 this.connected = false;
300 }
301
302 /**
303 * Holds the socket open for this caller. The zero-to-one transition calls
304 * connect(); every subsequent call increments an internal refcount without
305 * creating a second socket. Call release() when the caller no longer needs
306 * the connection. Callers must pair every acquire with exactly one release.
307 */
308 async acquire(): Promise<void> {
309 this.acquireCount++;

Callers 4

usePresenceSubscriptionFunction · 0.80
client.test.tsFile · 0.80

Calls 6

isConnectedMethod · 0.95
sendMethod · 0.95
pushMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected