Skip to content

RabbitQueue

faststream.rabbit.shared.schemas.RabbitQueue #

RabbitQueue(
    name: str,
    durable: bool = False,
    exclusive: bool = False,
    passive: bool = False,
    auto_delete: bool = False,
    arguments: Optional[AnyDict] = None,
    timeout: TimeoutType = None,
    robust: bool = True,
    bind_arguments: Optional[AnyDict] = None,
    routing_key: str = "",
)

Bases: NameRequired

A class to represent a RabbitMQ queue.

METHOD DESCRIPTION
__hash__

returns the hash value of the queue

routing

returns the routing key of the queue

__init__

initializes the RabbitQueue object with the given parameters

Note

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

Initialize a class object.

PARAMETER DESCRIPTION
name

The name of the object.

TYPE: str

durable

Whether the object is durable. Defaults to False.

TYPE: bool DEFAULT: False

exclusive

Whether the object is exclusive. Defaults to False.

TYPE: bool DEFAULT: False

passive

Whether the object is passive. Defaults to False.

TYPE: bool DEFAULT: False

auto_delete

Whether the object is auto delete. Defaults to False.

TYPE: bool DEFAULT: False

arguments

Additional arguments for the object. Defaults to None.

TYPE: dict DEFAULT: None

timeout

Timeout for the object. Defaults to None.

TYPE: TimeoutType DEFAULT: None

robust

Whether the object is robust. Defaults to True.

TYPE: bool DEFAULT: True

bind_arguments

Bind arguments for the object. Defaults to None.

TYPE: dict DEFAULT: None

routing_key

Routing key for the object. Defaults to "".

TYPE: str DEFAULT: ''

Note

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

Source code in faststream/rabbit/shared/schemas.py
def __init__(
    self,
    name: str,
    durable: bool = False,
    exclusive: bool = False,
    passive: bool = False,
    auto_delete: bool = False,
    arguments: Optional[AnyDict] = None,
    timeout: TimeoutType = None,
    robust: bool = True,
    bind_arguments: Optional[AnyDict] = None,
    routing_key: str = "",
):
    """Initialize a class object.

    Args:
        name (str): The name of the object.
        durable (bool, optional): Whether the object is durable. Defaults to False.
        exclusive (bool, optional): Whether the object is exclusive. Defaults to False.
        passive (bool, optional): Whether the object is passive. Defaults to False.
        auto_delete (bool, optional): Whether the object is auto delete. Defaults to False.
        arguments (dict, optional): Additional arguments for the object. Defaults to None.
        timeout (TimeoutType, optional): Timeout for the object. Defaults to None.
        robust (bool, optional): Whether the object is robust. Defaults to True.
        bind_arguments (dict, optional): Bind arguments for the object. Defaults to None.
        routing_key (str, optional): Routing key for the object. Defaults to "".
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    re, routing_key = compile_path(routing_key, replace_symbol="*")
    super().__init__(
        name=name,
        path_regex=re,
        durable=durable,
        exclusive=exclusive,
        bind_arguments=bind_arguments,
        routing_key=routing_key,
        robust=robust,
        passive=passive,
        auto_delete=auto_delete,
        arguments=arguments,
        timeout=timeout,
    )

arguments class-attribute instance-attribute #

arguments: Optional[AnyDict] = None

auto_delete class-attribute instance-attribute #

auto_delete: bool = False

bind_arguments class-attribute instance-attribute #

bind_arguments: Optional[AnyDict] = None

durable class-attribute instance-attribute #

durable: bool = False

exclusive class-attribute instance-attribute #

exclusive: bool = False

model_config class-attribute instance-attribute #

model_config = {'arbitrary_types_allowed': True}

name class-attribute instance-attribute #

name: str = ''

passive class-attribute instance-attribute #

passive: bool = False

path_regex class-attribute instance-attribute #

path_regex: Optional[Pattern[str]] = None

robust class-attribute instance-attribute #

robust: bool = True

routing property #

routing: Optional[str]

routing_key class-attribute instance-attribute #

routing_key: str = ''

timeout class-attribute instance-attribute #

timeout: TimeoutType = None

Config #

arbitrary_types_allowed class-attribute instance-attribute #

arbitrary_types_allowed = True

validate classmethod #

validate(
    value: Union[str, NameRequiredCls, None]
) -> Optional[NameRequiredCls]

Validates a value.

PARAMETER DESCRIPTION
value

The value to be validated.

TYPE: Union[str, NameRequiredCls, None]

RETURNS DESCRIPTION
Optional[NameRequiredCls]

The validated value.

Note

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

Source code in faststream/broker/schemas.py
@classmethod
def validate(
    cls: Type[NameRequiredCls], value: Union[str, NameRequiredCls, None]
) -> Optional[NameRequiredCls]:
    """Validates a value.

    Args:
        value: The value to be validated.

    Returns:
        The validated value.
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    if value is not None:
        if isinstance(value, str):
            value = cls(value)
    return value

Last update: 2023-11-13