Module slack_bolt.lazy_listener.runner

Classes

class LazyListenerRunner
Expand source code
class LazyListenerRunner(metaclass=ABCMeta):
    logger: Logger

    @abstractmethod
    def start(self, function: Callable[..., None], request: BoltRequest) -> None:
        """Starts a new lazy listener execution.

        Args:
            function: The function to run.
            request: The request to pass to the function. The object must be thread-safe.
        """
        raise NotImplementedError()

    def run(self, function: Callable[..., None], request: BoltRequest) -> None:
        """Synchronously runs the function with a given request data.

        Args:
            function: The function to run.
            request: The request to pass to the function. The object must be thread-safe.
        """
        build_runnable_function(
            func=function,
            logger=self.logger,
            request=request,
        )()

Subclasses

Class variables

var logger : logging.Logger

Methods

def run(self, function: Callable[..., None], request: BoltRequest) ‑> None

Synchronously runs the function with a given request data.

Args

function
The function to run.
request
The request to pass to the function. The object must be thread-safe.
def start(self, function: Callable[..., None], request: BoltRequest) ‑> None

Starts a new lazy listener execution.

Args

function
The function to run.
request
The request to pass to the function. The object must be thread-safe.