MCPcopy
hub / github.com/plotly/dash / disconnect

Method disconnect

dash/dash-renderer/src/utils/workerClient.ts:137–155  ·  view source on GitHub ↗

* Disconnect from the worker.

()

Source from the content-addressed store, hash-verified

135 * Disconnect from the worker.
136 */
137 public disconnect(): void {
138 if (this.worker) {
139 this.worker.port.postMessage({
140 type: WorkerMessageType.DISCONNECT,
141 rendererId: this.rendererId
142 });
143 this.worker.port.close();
144 this.worker = null;
145 }
146 this.isConnected = false;
147 this.connectionPromise = null;
148 this.connectionResolve = null;
149
150 // Resolve pending callbacks with prevent_update so loading states clear
151 for (const [, pending] of this.pendingCallbacks) {
152 pending.resolve({status: 'prevent_update'});
153 }
154 this.pendingCallbacks.clear();
155 }
156
157 /**
158 * Ensure the worker is connected, initiating connection if needed.

Callers 10

ResizeDetectorFunction · 0.45
RangeSliderFunction · 0.45
VrFunction · 0.45
aFunction · 0.45
uFunction · 0.45
iFunction · 0.45
ztFunction · 0.45
documentTitle.tsFile · 0.45
disconnectWebSocketFunction · 0.45

Calls 2

closeMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected