Relative Content

Tag Archive for pythondjangoredispython-asyncio

How to use Async Redis Client + Django in python?

I’m trying to create a distributed semaphore using Redis to use in my Django application. This is to limit concurrent requests to an API. I’m using asyncio in redis-py. However, I want to create a connection pool to share across requests since I was getting a “Max clients reached” error. Thus, I created a shared connection pool in settings.py which I use in my semaphore class. However, I then get an error got Future <Future pending> attached to a different loop when I make concurrent requests. This is my code: