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

Function _update_background_callback

dash/_callback.py:486–519  ·  view source on GitHub ↗

Set up the background callback and manage jobs.

(
    error_handler,
    callback_ctx,
    response,
    kwargs,
    background,
    multi,
    cache_key=None,
    job_id=None,
)

Source from the content-addressed store, hash-verified

484
485
486def _update_background_callback(
487 error_handler,
488 callback_ctx,
489 response,
490 kwargs,
491 background,
492 multi,
493 cache_key=None,
494 job_id=None,
495):
496 """Set up the background callback and manage jobs."""
497 callback_manager = _get_callback_manager(kwargs, background)
498
499 if cache_key is None or job_id is None:
500 adapter = get_app().backend.request_adapter()
501 cache_key = cache_key or (adapter.args.get("cacheKey") if adapter else None)
502 job_id = job_id or (adapter.args.get("job") if adapter else None)
503
504 _progress_background_callback(
505 response, callback_manager, background, cache_key=cache_key
506 )
507
508 output_value = callback_manager.get_result(cache_key, job_id)
509
510 return _handle_rest_background_callback(
511 output_value,
512 callback_manager,
513 response,
514 error_handler,
515 callback_ctx,
516 multi,
517 cache_key=cache_key,
518 job_id=job_id,
519 )
520
521
522def _handle_rest_background_callback(

Callers 3

get_task_resultFunction · 0.90
add_contextFunction · 0.85
async_add_contextFunction · 0.85

Calls 6

get_appFunction · 0.90
_get_callback_managerFunction · 0.70
getMethod · 0.45
get_resultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…