RedisBroker
faststream.redis.broker.RedisBroker #
RedisBroker(
url: str = "redis://localhost:6379",
polling_interval: float | None = None,
*,
protocol: str | None = None,
protocol_version: str | None = "custom",
security: BaseSecurity | None = None,
**kwargs: Any
)
Bases: RedisLoggingMixin
, BrokerAsyncUsecase[AnyRedisDict, 'Redis[bytes]']
Redis broker.
Redis broker.
PARAMETER | DESCRIPTION |
---|---|
url | URL of the Redis server DEFAULT: |
polling_interval | interval in seconds to poll the Redis server for new messages (default: None) DEFAULT: |
protocol | protocol of the Redis server (default: None) DEFAULT: |
protocol_version | protocol version of the Redis server (default: "custom") DEFAULT: |
security | security settings for the Redis server (default: None) DEFAULT: |
kwargs | additional keyword arguments DEFAULT: |
Source code in faststream/redis/broker.py
close async
#
close(
exc_type: Optional[Type[BaseException]] = None,
exc_val: Optional[BaseException] = None,
exec_tb: Optional[TracebackType] = None,
) -> None
Closes the object.
PARAMETER | DESCRIPTION |
---|---|
exc_type | The type of the exception being handled, if any. TYPE: |
exc_val | The exception instance being handled, if any. TYPE: |
exec_tb | The traceback of the exception being handled, if any. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
RAISES | DESCRIPTION |
---|---|
NotImplementedError | If the method is not implemented. |
Source code in faststream/broker/core/asynchronous.py
connect async
#
Connect to the Redis server.
PARAMETER | DESCRIPTION |
---|---|
args | additional positional arguments DEFAULT: |
kwargs | additional keyword arguments DEFAULT: |
Source code in faststream/redis/broker.py
include_router #
include_router(router: BrokerRouter[Any, 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/core/abc.py
include_routers #
include_routers(
*routers: BrokerRouter[Any, MsgType]
) -> None
Includes routers in the current object.
PARAMETER | DESCRIPTION |
---|---|
*routers | Variable length argument list of routers to include. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
Source code in faststream/broker/core/abc.py
publish async
#
publish_batch async
#
publisher #
publisher(
channel: Channel | PubSub | None = None,
list: Channel | ListSub | None = None,
stream: Channel | 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/broker.py
start async
#
Source code in faststream/redis/broker.py
subscriber #
subscriber(
channel: Channel | PubSub | None = None,
*,
list: Channel | ListSub | None = None,
stream: Channel | 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,
title: str | None = None,
description: str | None = None,
include_in_schema: bool = True,
**original_kwargs: Any
) -> Callable[
[Callable[P_HandlerParams, T_HandlerReturn]],
HandlerCallWrapper[
Any, P_HandlerParams, T_HandlerReturn
],
]
Source code in faststream/redis/broker.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|