Skip to content

NatsRoute

faststream.broker.router.BrokerRoute #

BrokerRoute(
    call: Callable[..., T_HandlerReturn],
    *args: Any,
    **kwargs: Any
)

Bases: Generic[MsgType, T_HandlerReturn]

A generic class to represent a broker route.

PARAMETER DESCRIPTION
call

callable object representing the route

*args

variable length arguments for the route

DEFAULT: ()

**kwargs

variable length keyword arguments for the route

DEFAULT: {}

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Initialize a callable object with arguments and keyword arguments.

PARAMETER DESCRIPTION
call

A callable object.

TYPE: Callable[..., T_HandlerReturn]

*args

Positional arguments to be passed to the callable object.

TYPE: Any DEFAULT: ()

**kwargs

Keyword arguments to be passed to the callable object.

TYPE: Any DEFAULT: {}

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/broker/router.py
def __init__(
    self,
    call: Callable[..., T_HandlerReturn],
    *args: Any,
    **kwargs: Any,
):
    """Initialize a callable object with arguments and keyword arguments.

    Args:
        call: A callable object.
        *args: Positional arguments to be passed to the callable object.
        **kwargs: Keyword arguments to be passed to the callable object.
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    self.call = call
    self.args = args
    self.kwargs = kwargs

args instance-attribute #

args: Tuple[Any, ...] = args

call instance-attribute #

call: Callable[..., T_HandlerReturn] = call

kwargs instance-attribute #

kwargs: AnyDict = kwargs

Last update: 2023-11-13