nv_dfm_core.session.CallbackRunner#

class nv_dfm_core.session.CallbackRunner(default_callback=None, place_callbacks=None)[source]#

Executes callbacks for a specific job.

Created by CallbackDispatcher.create_runner() when a job starts. The runner is bound to the callbacks provided at creation time and dispatches tokens to them according to the dispatcher’s strategy.

Parameters:
default_callback#

The default callback for unspecified places.

place_callbacks#

Dictionary mapping place names to specific callbacks.

property default_callback: DfmDataCallback | None#

The default callback for places without specific callbacks.

abstractmethod dispatch(tokens)[source]#

Dispatch tokens to callbacks according to the dispatcher’s strategy.

Parameters:

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

Return type:

None

property place_callbacks: dict[str, DfmDataCallback]#

Dictionary mapping place names to specific callbacks.

start()[source]#

Called when the job’s background thread starts.

Override if the runner needs to perform setup when the job starts.

Return type:

None

stop()[source]#

Called when the job’s background thread stops.

Override if the runner needs to perform cleanup when the job ends.

Return type:

None