Skip to content

strategy

dandy.processor.agent.strategy

ProcessorsStrategy

Bases: BaseProcessorsStrategy

Source code in dandy/processor/strategy.py
def __init__(
        self,
        processors: Sequence[Type[BaseProcessor]]
):
    self.processors = processors

    if self._processor_controller is None:
        raise DandyCriticalException(f'{self.__name__}._processor_controller is not set')

    for processor_class in self.processors:
        if not issubclass(processor_class, BaseProcessor):
            raise DandyCriticalException(
                'All resources must be sub classed from the "BaseProcessor" sub class.'
            )

        if processor_class.description is None:
            raise DandyCriticalException(
                f'{processor_class.__name__} did not have the class attribute "description". All "processors" must have a "description" class attribute to be used with a "ProcessorStrategy".'
            )