Skip to content

Manager

Manager

Manager()

Manager class that manages the registration and execution of different processes, including collecting, checking, extraction, and pushing to the database.

Attributes:

  • context (Context) –

    The shared context for managing data among the different processes.

  • collectors (List[Collect]) –

    A list of collecting processes.

  • checks (List[Check]) –

    A list of checking processes.

  • extractors (List[Extract]) –

    A list of extraction processes.

  • pushes (List[Push]) –

    A list of push processes for database operations.

Methods:

  • add_callback

    Adds a callback function to be executed after the process finishes.

  • processes

    Returns a dictionary with all the registered processes.

  • publish

    Executes the registered processes in sequence.

  • register

    Registers a process in the correct category based on its type.

callbacks property

callbacks: Dict[Type[Callback], Callable]

Returns the dict of registered callbacks.

context property

context

Gets the shared context for the Manager.

add_callback

add_callback(callback_type: Callback, callback: callable) -> None

Adds a callback function to be executed after the process finishes.

processes

processes() -> Dict[str, List[Process]]

Returns a dictionary with all the registered processes.

Returns:

  • dict ( Dict[str, List[Process]] ) –

    A dictionary with process types as keys and lists of instances as values.

publish

publish() -> Iterator[str]

Executes the registered processes in sequence.

register

register(process: Process) -> None

Registers a process in the correct category based on its type.

Parameters:

  • process

    (Process) –

    An process of a subclass of Process to be registered.

Raises:

  • ValueError

    If the process type is unknown.