-
I am using Redis. I want my faststream application to publish a certain message once another list (or stream). @broker.publisher("triggermeonempty")
@broker.subscriber(stream="checkme", trigger_on_empty=True)
def run_me(msg):
return "checkme is empty, do something about it" Or maybe is it possible to get the length of the list within the subscriber? |
Beta Was this translation helpful? Give feedback.
Answered by
Lancetnik
Jul 30, 2024
Replies: 1 comment
-
@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") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lancetnik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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: