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

Function on_done

dash/backends/ws.py:349–389  ·  view source on GitHub ↗
(f: concurrent.futures.Future)

Source from the content-addressed store, hash-verified

347 """
348
349 def on_done(f: concurrent.futures.Future) -> None:
350 try:
351 if shutdown_event.is_set():
352 return
353 result = f.result()
354 outbound_queue.sync_q.put_nowait(
355 cast(
356 str,
357 to_json(
358 {
359 "type": "callback_response",
360 "rendererId": renderer_id,
361 "requestId": request_id,
362 "payload": result,
363 }
364 ),
365 )
366 )
367 except Exception as e: # pylint: disable=broad-exception-caught
368 if shutdown_event.is_set():
369 return
370 outbound_queue.sync_q.put_nowait(
371 cast(
372 str,
373 to_json(
374 {
375 "type": "callback_response",
376 "rendererId": renderer_id,
377 "requestId": request_id,
378 "payload": {
379 "status": "error",
380 "message": str(e),
381 },
382 }
383 ),
384 )
385 )
386 finally:
387 pending_callbacks.pop(request_id, None)
388 if not shutdown_event.is_set():
389 outbound_queue.sync_q.put_nowait(FLUSH_SIGNAL)
390
391 return on_done
392

Callers

nothing calls this directly

Calls 2

to_jsonFunction · 0.90
popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…