redis

Setup an email notification when consumer: Connection to broker lost in celery

Setup an email notification when consumer: Connection to broker lost in celery Question: I want to implement an email system which will send an email whenever my celery worker lost connection with my Redis server. Whenever it lost connection it gives warning: [2023-03-02 21:33:48,272: WARNING/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection… …

Total answers: 1

Is it possible to enqueue an instance method, as opposed to a function, using Python-RQ?

Is it possible to enqueue an instance method, as opposed to a function, using Python-RQ? Question: The examples provided in the Python-RQ documentation consistently show functions being enqueued, using queue.enqueue(). For example: job = q.enqueue(count_words_at_url, ‘http://nvie.com’) Is it possible to enqueue a method of a particular object instance? And if so, is this considered reasonable …

Total answers: 1

Release redis lock if process die

Release redis lock if process die Question: I’m using redis distributed locks to make sure some celery tasks don’t run concurrently. For managing locks with redis I’m using the python redis library version 4.0.0 (which specifies that any deadlock problems should be handled by the programmer). Since I would like to avoid using the timeout …

Total answers: 1

Shuffle a small list in Redis DB

Shuffle a small list in Redis DB Question: i need to shuffle a small list (100 elements) in my Redis DB with Python. Or is it easier to do the shuffling locally and then save it to the DB? Is it possible? Asked By: EliaTolin || Source Answers: There is no Redis list command to …

Total answers: 1

Use of secondary indexes in a redis database in comparison with SQL statements

Use of secondary indexes in a redis database in comparison with SQL statements Question: I’m working with a redis database. I have already implemented Python code to access the redis server. The problem is that the code implemented is very complex and it is not easy maintainable. Secondary indexes in Redis database To simplify the …

Total answers: 1

Understanding xreadgroup command

Understanding xreadgroup command Question: I have written redis stream consumer in python and the minimal code looks as below: key = ‘order_completed’ group = ‘inventory_group’ redis.xgroup_create(key, group) #statement1 result = redis.xreadgroup(group, key, {key: ‘>’}, None) #statement2 I need help to understand the last two statements. My limited understanding is that redis.xgroup_create(key, group) is creating a …

Total answers: 1

TypeError: AsyncConsumer.__call__() missing 1 required positional argument: 'send

TypeError: AsyncConsumer.__call__() missing 1 required positional argument: 'send Question: Well I am using channels as WebSocket and redis as storage to build chat application in Django.so to accomplish connection between the websocketconsumer with asgi file. I am trying to run the django server on windows but I am getting the following error, help me. Error …

Total answers: 1

Channels-redis wont install using pip

Channels-redis wont install using pip Question: im trying to install channels-redis using pip install -U pip channels-redis but it cause the following error: Error: Using legacy ‘setup.py install’ for hiredis, since package ‘wheel’ is not installed. Installing collected packages: hiredis, async-timeout, aioredis, channels-redis Running setup.py install for hiredis … error error: subprocess-exited-with-error × Running setup.py …

Total answers: 2

How to use Celery to upload files in Django

How to use Celery to upload files in Django Question: I was wondering how I can use Celery workers to handle file uploads. So I tried implementing it on a simple class. I overrided the create class in my ModelViewSet. But apparently Django’s default json encoder does not serialize ImageFields (Lame). I’ll really appreciate it …

Total answers: 2