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

Method _dispatch_async

dash/backends/_flask.py:273–286  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271 return cb_ctx.dash_response.set_response(data=response_data)
272
273 async def _dispatch_async():
274 body = request.get_json()
275 # pylint: disable=protected-access
276 cb_ctx = dash_app._initialize_context(body)
277 func = dash_app._prepare_callback(cb_ctx, body)
278 args = dash_app._inputs_to_vals(cb_ctx.inputs_list + cb_ctx.states_list)
279 ctx = copy_context()
280 partial_func = dash_app._execute_callback(
281 func, args, cb_ctx.outputs_list, cb_ctx
282 )
283 response_data = ctx.run(partial_func)
284 if asyncio.iscoroutine(response_data):
285 response_data = await response_data
286 return cb_ctx.dash_response.set_response(data=response_data)
287
288 if dash_app._use_async: # pylint: disable=protected-access
289 return _dispatch_async

Callers

nothing calls this directly

Calls 7

_initialize_contextMethod · 0.80
_prepare_callbackMethod · 0.80
_inputs_to_valsMethod · 0.80
_execute_callbackMethod · 0.80
get_jsonMethod · 0.45
runMethod · 0.45
set_responseMethod · 0.45

Tested by

no test coverage detected