RedisRouter
faststream.redis.RedisRouter #
RedisRouter(prefix: str = '', handlers: Sequence[RedisRoute] = (), *, dependencies: Sequence[Depends] = (), parser: CustomParser[AnyRedisDict, RedisMessage] | None = None, decoder: CustomDecoder[RedisMessage] | None = None, middlewares: Sequence[Callable[[AnyRedisDict], BaseMiddleware]] | None = None, include_in_schema: bool = True)
Bases: RedisRouter
A class to represent a Redis router.
Source code in faststream/redis/router.py
include_router #
include_router(router: BrokerRouter[PublisherKeyType, MsgType]) -> None
Includes a router in the current object.
PARAMETER | DESCRIPTION |
---|---|
router | The router to be included. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
Source code in faststream/broker/router.py
include_routers #
include_routers(*routers: BrokerRouter[PublisherKeyType, MsgType]) -> None
Includes routers in the object.
PARAMETER | DESCRIPTION |
---|---|
*routers | Variable length argument list of routers to include. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
Source code in faststream/broker/router.py
publisher #
publisher(channel: str | PubSub | None = None, list: str | ListSub | None = None, stream: str | StreamSub | None = None, headers: AnyDict | None = None, reply_to: str = '', title: str | None = None, description: str | None = None, schema: Any | None = None, include_in_schema: bool = True) -> Publisher
Source code in faststream/redis/router.py
subscriber #
subscriber(channel: str | PubSub | None = None, *, list: str | ListSub | None = None, stream: str | StreamSub | None = None, dependencies: Sequence[Depends] = (), parser: CustomParser[AnyRedisDict, RedisMessage] | None = None, decoder: CustomDecoder[RedisMessage] | None = None, middlewares: Sequence[Callable[[AnyRedisDict], BaseMiddleware]] | None = None, filter: Filter[RedisMessage] = default_filter, no_ack: bool = False, title: str | None = None, description: str | None = None, include_in_schema: bool = True, **__service_kwargs: Any) -> Callable[[Callable[P_HandlerParams, T_HandlerReturn]], HandlerCallWrapper[Any, P_HandlerParams, T_HandlerReturn]]