Skip to main content

prefect_redis.messaging

Functions

ephemeral_subscription

ephemeral_subscription(topic: str, source: Optional[str] = None, group: Optional[str] = None) -> AsyncGenerator[dict[str, Any], None]

break_topic

break_topic()

Classes

RedisMessagingPublisherSettings

Settings for the Redis messaging publisher. No settings are required to be set by the user but any of the settings can be overridden by the user using environment variables.

RedisMessagingConsumerSettings

Settings for the Redis messaging consumer. No settings are required to be set by the user but any of the settings can be overridden by the user using environment variables.

Cache

Methods:

clear_recently_seen_messages

clear_recently_seen_messages(self) -> None

forget_duplicates

forget_duplicates(self, attribute: str, messages: list[M]) -> None

without_duplicates

without_duplicates(self, attribute: str, messages: list[M]) -> list[M]

RedisStreamsMessage

A message sent to a Redis stream. Methods:

acknowledge

acknowledge(self) -> None

Subscription

A subscription-like object for Redis. We mimic the memory subscription interface so that we can set max_retries and handle dead letter queue storage in Redis.

Publisher

Methods:

publish_data

publish_data(self, data: bytes, attributes: dict[str, Any])

Consumer

Consumer implementation for Redis Streams with DLQ support. Methods:

process_pending_messages

process_pending_messages(self, handler: MessageHandler, redis_client: Redis, message_batch_size: int, start_id: str = '0-0')

run

run(self, handler: MessageHandler) -> None