MCPcopy Index your code
hub / github.com/coder/mux / removeSubscriber

Method removeSubscriber

src/node/services/sessionTimingService.ts:194–210  ·  view source on GitHub ↗
(workspaceId: string)

Source from the content-addressed store, hash-verified

192 }
193
194 removeSubscriber(workspaceId: string): void {
195 const current = this.subscriberCounts.get(workspaceId) ?? 0;
196 const next = Math.max(0, current - 1);
197 if (next === 0) {
198 this.subscriberCounts.delete(workspaceId);
199
200 const interval = this.tickIntervals.get(workspaceId);
201 if (interval) {
202 clearInterval(interval);
203 this.tickIntervals.delete(workspaceId);
204 }
205
206 this.clearDeltaEmitState(workspaceId);
207 return;
208 }
209 this.subscriberCounts.set(workspaceId, next);
210 }
211
212 onStatsChange(listener: (workspaceId: string) => void): void {
213 this.emitter.on("change", listener);

Callers 2

routerFunction · 0.80

Calls 4

clearDeltaEmitStateMethod · 0.95
setMethod · 0.80
getMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected