Skip to content

validate_options

faststream.redis.schemas.proto.validate_options #

validate_options(*, channel, list, stream)
Source code in faststream/redis/schemas/proto.py
def validate_options(
    *,
    channel: PubSub | str | None,
    list: ListSub | str | None,
    stream: StreamSub | str | None,
) -> None:
    if all((channel, list)):
        msg = "You can't use `PubSub` and `ListSub` both"
        raise SetupError(msg)
    if all((channel, stream)):
        msg = "You can't use `PubSub` and `StreamSub` both"
        raise SetupError(msg)
    if all((list, stream)):
        msg = "You can't use `ListSub` and `StreamSub` both"
        raise SetupError(msg)