nv_dfm_core.session.ManualDispatcher#
- class nv_dfm_core.session.ManualDispatcher[source]#
Dispatcher that queues tokens for manual processing.
Tokens are queued and the user must periodically call: - job.callback_runner.process_pending() for sync callbacks - await job.callback_runner.process_pending_async() for async callbacks
This is useful for applications like Kit that need callbacks to run on the main thread.
Example:
# Setup session = Session( federation_name="my_fed", homesite="site1", callback_dispatcher=ManualDispatcher() ) job = session.execute(pipeline, default_callback=my_callback) # In your main thread's update loop: def on_update(): runner = job.callback_runner if runner and runner.has_pending(): runner.process_pending()
- create_runner(default_callback=None, place_callbacks=None)[source]#
Create a ManualCallbackRunner for queued callback execution.
- 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.
- Returns:
A ManualCallbackRunner instance with a token queue.
- Return type: