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: Union["PubSub", str, None],
    list: Union["ListSub", str, None],
    stream: Union["StreamSub", str, None],
) -> None:
    if all((channel, list)):
        raise SetupError("You can't use `PubSub` and `ListSub` both")
    elif all((channel, stream)):
        raise SetupError("You can't use `PubSub` and `StreamSub` both")
    elif all((list, stream)):
        raise SetupError("You can't use `ListSub` and `StreamSub` both")