betty.dispatch - Betty 0.4.0a1 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# Source code for betty.dispatch

    """
    Provide the Dispatch API.
    """

    from typing import Any, Sequence, Callable, Awaitable

    TargetedDispatcher = Callable[..., Awaitable[Sequence[Any]]]

    class Dispatcher:
        """
        Dispatch events to handlers.
        """

        def dispatch(self, target_type: type[Any]) -> TargetedDispatcher:
            """
            Dispatch a single target.
            """
            raise NotImplementedError(repr(self))