MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / dispose

Method dispose

src/workspaces/session-pool.ts:183–193  ·  view source on GitHub ↗

Dispose ALL sessions for a workspace (DELETE /workspaces/:id).

(wsId: string, reason: string)

Source from the content-addressed store, hash-verified

181
182 /** Dispose ALL sessions for a workspace (DELETE /workspaces/:id). */
183 dispose(wsId: string, reason: string): boolean {
184 const ids = this.byWs.get(wsId);
185 if (!ids || ids.size === 0) return false;
186 // Copy first — session.dispose() triggers onDisposed which mutates byWs.
187 const snapshot = Array.from(ids);
188 for (const id of snapshot) {
189 const s = this.sessions.get(id);
190 if (s) s.dispose(reason);
191 }
192 return true;
193 }
194
195 disposeAll(reason: string): void {
196 for (const session of Array.from(this.sessions.values())) {

Callers

nothing calls this directly

Calls 3

fromMethod · 0.80
getMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected