tardunge commented on code in PR #63937:
URL: https://github.com/apache/airflow/pull/63937#discussion_r3146932052
##########
providers/redis/src/airflow/providers/redis/hooks/redis.py:
##########
@@ -98,6 +100,52 @@ def get_conn(self):
return self.redis
+ @asynccontextmanager
+ async def get_async_conn(self) -> AsyncIterator[Any]:
+ """
+ Return an async Redis connection using ``redis.asyncio``.
+
+ This is an async context manager that creates and cleans up an async
Redis connection.
+ Useful for triggers and other async components that need non-blocking
Redis access.
+
+ Usage::
+
+ async with hook.get_async_conn() as redis_conn:
+ await redis_conn.brpop("my_list", timeout=10)
+ """
+ from redis.asyncio import Redis as AsyncRedis
Review Comment:
moved, to the top and the dep is already required, no circular dep issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]