Skip to content

ProcessingService class

Bases: ABC

A base class that defines a common interface for processing calls.

Notes:

  • The main goal of this class is to decouple the process of executing calls from the underlying implementation, thereby establishing a template for defining a variety of strategies to manage the execution.
Source code in pyventus/core/processing/processing_service.py
class ProcessingService(ABC):
    """
    A base class that defines a common interface for processing calls.

    **Notes:**

    -   The main goal of this class is to decouple the process of executing calls from
        the underlying implementation, thereby establishing a template for defining a
        variety of strategies to manage the execution.
    """

    # Allow subclasses to define __slots__
    __slots__ = ()

    @abstractmethod
    def submit(self, callback: ProcessingServiceCallbackType, *args: Any, **kwargs: Any) -> None:
        """
        Submit a callback along with its arguments for execution.

        Subclasses must implement this method to define the specific execution strategy.

        :param callback: The callback to be executed.
        :param args: Positional arguments to be passed to the callback.
        :param kwargs: Keyword arguments to be passed to the callback.
        :return: None.
        """
        pass

Functions

submit abstractmethod

submit(callback: ProcessingServiceCallbackType, *args: Any, **kwargs: Any) -> None

Submit a callback along with its arguments for execution.

Subclasses must implement this method to define the specific execution strategy.

PARAMETER DESCRIPTION
callback

The callback to be executed.

TYPE: ProcessingServiceCallbackType

args

Positional arguments to be passed to the callback.

TYPE: Any DEFAULT: ()

kwargs

Keyword arguments to be passed to the callback.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
None

None.

Source code in pyventus/core/processing/processing_service.py
@abstractmethod
def submit(self, callback: ProcessingServiceCallbackType, *args: Any, **kwargs: Any) -> None:
    """
    Submit a callback along with its arguments for execution.

    Subclasses must implement this method to define the specific execution strategy.

    :param callback: The callback to be executed.
    :param args: Positional arguments to be passed to the callback.
    :param kwargs: Keyword arguments to be passed to the callback.
    :return: None.
    """
    pass