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

Method onConnected

packages/event-service/src/client.ts:325–333  ·  view source on GitHub ↗

* Registers a handler that fires every time the underlying WebSocket * transitions to OPEN — including the very first successful connect. * * If the socket is already connected at call time, the handler is called * synchronously before this method returns, then added to the set so it

(handler: () => void)

Source from the content-addressed store, hash-verified

323 this.acquireCount--;
324 if (this.acquireCount === 0) {
325 this.disconnect();
326 }
327 }
328
329 isConnected(): boolean {
330 return this.connected && this.ws !== null && this.ws.readyState === WebSocket.OPEN;
331 }
332
333 subscribe(contexts: string[]): void {
334 const newlyActive: string[] = [];
335 for (const ctx of contexts) {
336 const next = (this.activeContexts.get(ctx) ?? 0) + 1;

Callers 3

useBotStatusFunction · 0.80
client.test.tsFile · 0.80
connectInternalFunction · 0.80

Calls 4

isConnectedMethod · 0.95
addMethod · 0.80
deleteMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected