Skip to content

Publish message when a list/stream is empty? #1611

Answered by Lancetnik
Dronakurl asked this question in Q&A
Discussion options

You must be logged in to vote

@Dronakurl sorry for answering so late! Unfortunatelly, we have no such functional, but you can get access to raw Redis client inside your subscriber and make anything you want with it:

from faststream.redis.annotations import Redis

@broker.subscriber(...)
async def handler(msg, redis: Redis):
    list_len: int = await redis.llen("listname")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Lancetnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants