Skip to content

RedisResponse

faststream.redis.RedisResponse #

RedisResponse(body=None, *, headers=None, correlation_id=None, maxlen=None)

Bases: Response

Source code in faststream/redis/response.py
def __init__(
    self,
    body: Optional["SendableMessage"] = None,
    *,
    headers: Optional["AnyDict"] = None,
    correlation_id: Optional[str] = None,
    maxlen: Optional[int] = None,
) -> None:
    super().__init__(
        body=body,
        headers=headers,
        correlation_id=correlation_id,
    )
    self.maxlen = maxlen

body instance-attribute #

body = body

headers instance-attribute #

headers = headers or {}

correlation_id instance-attribute #

correlation_id = correlation_id

maxlen instance-attribute #

maxlen = maxlen

add_headers #

add_headers(extra_headers, *, override=True)
Source code in faststream/broker/response.py
def add_headers(
    self,
    extra_headers: "AnyDict",
    *,
    override: bool = True,
) -> None:
    if override:
        self.headers = {**self.headers, **extra_headers}
    else:
        self.headers = {**extra_headers, **self.headers}

as_publish_kwargs #

as_publish_kwargs()
Source code in faststream/redis/response.py
@override
def as_publish_kwargs(self) -> "AnyDict":
    publish_options = {
        **super().as_publish_kwargs(),
        "maxlen": self.maxlen,
    }
    return publish_options