(
callback_list,
callback_map,
config_prevent_initial_callbacks,
output,
outputs_indices,
inputs,
state,
inputs_state_indices,
prevent_initial_call,
background=None,
manager=None,
running=None,
dynamic_creator: Optional[bool] = False,
no_output=False,
optional=False,
hidden=None,
websocket=False,
persistent=False,
mcp_enabled=None,
mcp_expose_docstring=None,
)
| 282 | |
| 283 | # pylint: disable=too-many-arguments |
| 284 | def insert_callback( |
| 285 | callback_list, |
| 286 | callback_map, |
| 287 | config_prevent_initial_callbacks, |
| 288 | output, |
| 289 | outputs_indices, |
| 290 | inputs, |
| 291 | state, |
| 292 | inputs_state_indices, |
| 293 | prevent_initial_call, |
| 294 | background=None, |
| 295 | manager=None, |
| 296 | running=None, |
| 297 | dynamic_creator: Optional[bool] = False, |
| 298 | no_output=False, |
| 299 | optional=False, |
| 300 | hidden=None, |
| 301 | websocket=False, |
| 302 | persistent=False, |
| 303 | mcp_enabled=None, |
| 304 | mcp_expose_docstring=None, |
| 305 | ) -> str: |
| 306 | if prevent_initial_call is None: |
| 307 | prevent_initial_call = config_prevent_initial_callbacks |
| 308 | |
| 309 | _validate.validate_duplicate_output( |
| 310 | output, prevent_initial_call, config_prevent_initial_callbacks |
| 311 | ) |
| 312 | |
| 313 | callback_id = create_callback_id(output, inputs, no_output) |
| 314 | callback_spec = { |
| 315 | "output": callback_id, |
| 316 | "inputs": [c.to_dict() for c in inputs], |
| 317 | "state": [c.to_dict() for c in state], |
| 318 | "clientside_function": None, |
| 319 | # prevent_initial_call can be a string "initial_duplicates" |
| 320 | # which should not prevent the initial call. |
| 321 | "prevent_initial_call": prevent_initial_call is True, |
| 322 | "background": background |
| 323 | and { |
| 324 | "interval": background["interval"], |
| 325 | }, |
| 326 | "dynamic_creator": dynamic_creator, |
| 327 | "no_output": no_output, |
| 328 | "optional": optional, |
| 329 | "hidden": hidden, |
| 330 | "websocket": websocket, |
| 331 | "persistent": persistent, |
| 332 | } |
| 333 | if running: |
| 334 | callback_spec["running"] = running |
| 335 | |
| 336 | callback_map[callback_id] = { |
| 337 | "inputs": callback_spec["inputs"], |
| 338 | "state": callback_spec["state"], |
| 339 | "outputs_indices": outputs_indices, |
| 340 | "inputs_state_indices": inputs_state_indices, |
| 341 | "background": background, |
no test coverage detected
searching dependent graphs…