nv_ingest.framework.util.flow_control package#
Submodules#
nv_ingest.framework.util.flow_control.filter_by_task module#
- nv_ingest.framework.util.flow_control.filter_by_task.filter_by_task(
- required_tasks: List[str | Tuple[Any, ...]],
- forward_func: Callable[[Any], Any] | None = None,
Decorator that checks whether an IngestControlMessage contains any of the required tasks. Supports both synchronous and asynchronous functions as well as class methods (with ‘self’). If no required task is found, the original message is returned (or forward_func is called if provided).
- Parameters:
required_tasks (list[Union[str, Tuple[Any, ...]]]) – A list of required tasks. Each element is either a string representing a task name or a tuple/list where the first element is the task name and the remaining elements specify required task properties.
forward_func (Optional[Callable[[Any], Any]]) – A function to be called with the IngestControlMessage if no required task is found.
- Returns:
A decorator wrapping a function that expects an IngestControlMessage as one of its first arguments.
- Return type:
Callable
Module contents#
- nv_ingest.framework.util.flow_control.filter_by_task(
- required_tasks: List[str | Tuple[Any, ...]],
- forward_func: Callable[[Any], Any] | None = None,
Decorator that checks whether an IngestControlMessage contains any of the required tasks. Supports both synchronous and asynchronous functions as well as class methods (with ‘self’). If no required task is found, the original message is returned (or forward_func is called if provided).
- Parameters:
required_tasks (list[Union[str, Tuple[Any, ...]]]) – A list of required tasks. Each element is either a string representing a task name or a tuple/list where the first element is the task name and the remaining elements specify required task properties.
forward_func (Optional[Callable[[Any], Any]]) – A function to be called with the IngestControlMessage if no required task is found.
- Returns:
A decorator wrapping a function that expects an IngestControlMessage as one of its first arguments.
- Return type:
Callable