nv_dfm_core.session.call_callbacks#

nv_dfm_core.session.call_callbacks(default_callback, place_callbacks, tokens)[source]#

Call sync callbacks for the given tokens.

This unifies the callback invocation logic from FlareJob._distribute_tokens() and LocalJob._invoke_token_callback().

A token’s payload is deserialized here (unwrap_data()), on the app side, which can fail for a malformed, corrupted, or version-skewed yield. Rather than letting that failure escape (crashing the receive thread or the caller’s process_pending() thread) or being silently dropped, it is surfaced to the user as an ErrorToken via the status/default callback – see _select_error_callback.

Parameters:
  • default_callback (DfmDataCallback | None) – Fallback callback for tokens without a place-specific callback.

  • place_callbacks (dict[str, DfmDataCallback] | None) – Dictionary mapping place names to callbacks.

  • tokens (TokenPackage | list[TokenPackage] | None) – Single token or list of tokens to process.

Return type:

None