StreamBatchSubscriber
faststream.redis.subscriber.usecases.stream_subscriber.StreamBatchSubscriber #
StreamBatchSubscriber(
config: RedisSubscriberConfig,
specification: SubscriberSpecification[Any, Any],
calls: CallsCollection[Any],
)
Bases: _StreamHandlerMixin
Source code in faststream/redis/subscriber/usecases/stream_subscriber.py
start async #
Source code in faststream/redis/subscriber/usecases/stream_subscriber.py
stop async #
Clean up handler subscription, cancel consume task in graceful mode.
add_call #
add_call(
*,
parser_: Optional[CustomCallable],
decoder_: Optional[CustomCallable],
dependencies_: Iterable[Dependant],
) -> Self
Source code in faststream/_internal/endpoint/subscriber/usecase.py
consume async #
Consume a message asynchronously.
Source code in faststream/_internal/endpoint/subscriber/usecase.py
process_message async #
process_message(msg: MsgType) -> Response
Execute all message processing stages.
Source code in faststream/_internal/endpoint/subscriber/usecase.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
get_one async #
get_one(
*, timeout: float = 5.0
) -> RedisStreamMessage | None
Source code in faststream/redis/subscriber/usecases/stream_subscriber.py
get_log_context #
get_log_context(
message: Optional[StreamMessage[Any]],
) -> dict[str, str]
schema #
schema() -> dict[str, SubscriberSpec]
add_task #
add_task(
func: Callable[..., Coroutine[Any, Any, Any]],
func_args: tuple[Any, ...] | None = None,
func_kwargs: dict[str, Any] | None = None,
) -> Task[Any]
Source code in faststream/_internal/endpoint/subscriber/mixins.py
build_log_context staticmethod #
build_log_context(
message: Optional[StreamMessage[Any]], channel: str = ""
) -> dict[str, str]