Skip to content

validate_options

faststream.redis.schemas.proto.validate_options #

validate_options(
    *,
    channel: PubSub | str | None,
    list: ListSub | str | None,
    stream: StreamSub | str | None,
) -> None
Source code in faststream/redis/schemas/proto.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)