MCPcopy Index your code
hub / github.com/plotly/dash / sendCallback

Method sendCallback

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

* Send a callback request to the server via the worker. * @param payload The callback payload * @returns Promise that resolves with the callback response

(payload: unknown)

Source from the content-addressed store, hash-verified

206 * @returns Promise that resolves with the callback response
207 */
208 public async sendCallback(payload: unknown): Promise<CallbackResponse> {
209 // Wait for initial connection if one is in progress
210 if (this.connectionPromise && !this.isConnected) {
211 await this.connectionPromise;
212 }
213
214 if (!this.worker) {
215 throw new Error('Worker not connected');
216 }
217
218 const requestId = `${this.rendererId}-${++this.requestCounter}`;
219
220 return new Promise((resolve, reject) => {
221 this.pendingCallbacks.set(requestId, {resolve, reject});
222
223 this.worker!.port.postMessage({
224 type: WorkerMessageType.CALLBACK_REQUEST,
225 rendererId: this.rendererId,
226 requestId,
227 payload
228 });
229 });
230 }
231
232 /**
233 * Send a get_props response back to the server.

Callers 1

handleWebsocketCallbackFunction · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected