Skip to content

Push

Push

Push(manager: Manager)

              flowchart LR
              publisher.core.Push[Push]
              publisher.core.Process[Process]

                              publisher.core.Process --> publisher.core.Push
                


              click publisher.core.Push href "" "publisher.core.Push"
              click publisher.core.Process href "" "publisher.core.Process"
            

A class representing the process to push data to the database.

Methods:

  • add_callback

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

  • add_error

    Adds an error to the list of errors.

  • process

    The core logic of the process. This method should be implemented by subclasses with specific logic for the process.

  • set_status

    Sets the status of the process.

Attributes:

callbacks property

callbacks: Dict[Type[Callback], Callable]

Returns the dict of registered callbacks.

context property

context: Context

Returns the shared context.

errors property

errors: List[ErrorProcess]

Returns the list of errors encountered during execution.

status property

status: StatusProcess

Returns the current status of the process.

add_callback

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

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

add_error

add_error(error: Optional[str] = 'Unknown error', details: Optional[str] = 'Unknown details', items: Optional[List[str]] = None) -> None

Adds an error to the list of errors.

Parameters:

  • error

    (str, default: 'Unknown error' ) –

    The error message or name.

  • details

    (str, default: 'Unknown details' ) –

    Detailed description of the error.

  • items

    (list, default: None ) –

    Optional list of items related to the error.

process abstractmethod

process(context: Context) -> None

The core logic of the process. This method should be implemented by subclasses with specific logic for the process.

Parameters:

  • context

    (Context) –

    The shared context for accessing and storing data during execution.

Raises:

  • NotImplementedError

    If the subclass does not implement this method.

set_status

set_status(status: StatusProcess) -> None

Sets the status of the process.

Parameters: