Dramatiq is a distributed task processing library for Python 3.
Questions tagged [dramatiq]
34 questions
7
votes
1 answer
Dramatiq doesn't add tasks to the queue
I'm trying to run some dramatiq actors from my Falcon API method, like this:
def on_post(self, req, resp):
begin_id = int(req.params["begin_id"])
count = int(req.params["count"])
for page_id in range(begin_id, begin_id + count):
…

keddad
- 1,398
- 3
- 14
- 35
4
votes
1 answer
Dramatq - Consumer encountered a connection error
When I try to run dramatiq from the command line, it gives me the below error.
I'm currently using RabbitMQ.
[Thread-2] [dramatiq.worker.ConsumerThread(default)] [CRITICAL] Consumer encountered a connection error: (406, "PRECONDITION_FAILED -…

LEE
- 3,335
- 8
- 40
- 70
3
votes
1 answer
what can i do to use dramatiq in flask app
following this tutorial https://github.com/Bogdanp/dramatiq I created a simple python script to check if it works or not. I did some simple operations as follows
It did work fine.
please note that there are two terminals,
and one to run script and…

Akshad Patil
- 47
- 1
- 6
2
votes
1 answer
How to get a dramatiq worker work from within a script?
I'm new to dramatiq an experimenting for a couple of days and I'm not getting a worker to work within a (simple) script.
test.py
import dramatiq
from dramatiq.brokers.redis import RedisBroker
from dramatiq.results.backends import RedisBackend
from…

wkamer
- 75
- 7
2
votes
2 answers
How to restart Dramatiq in Windows on code update or server restart?
I am using Django-Dramatiq with Dramatiq and RabbitMQ. I have it all working, but I am not sure the proper way to deploy to a Windows Server. If the server restarts, how do I make sure that the workers start again? If I deploy new code changes,…

Douglas T
- 181
- 2
- 7
2
votes
0 answers
DB is overwhelmed by background periodic tasks in Django App
We have a Django application that has to consume a third-party API periodically to fetch a large amount of data for a set of users. The tasks are performing fine and fullfill their purpose. But after a period of time, we start getting too many…

dstrants
- 7,423
- 2
- 19
- 27
2
votes
2 answers
How to get the processed results from dramatiq python?
import dramatiq
from dramatiq.brokers.redis import RedisBroker
from dramatiq.results import Results
from dramatiq.results.backends import RedisBackend
broker = RedisBroker(host="127.0.0.1",…

Vaibhav
- 507
- 2
- 4
- 20
2
votes
0 answers
How to get dramatiq to work with redis in a Windows / WSL environment?
I've created a simple script to test dramatiq with redis:
broker_redis = RedisBroker(host='localhost', port=6379)
@dramatiq.actor
def sq(x):
time.sleep(random.randint(2, 4))
return x * x
I'm using this command to run inside WSL (as…

m01010011
- 895
- 8
- 13
2
votes
2 answers
Create a new decorator from an existing one
I'm using dramatiq for my task queue which offers the decorator @dramatiq.actor to decorate a function as a task. I've tried to write my own decorator that wraps the @dramatiq.actor decorator so I can add a default argument to the @dramatiq.actor…

Nepo Znat
- 3,000
- 5
- 28
- 49
1
vote
1 answer
Is it possible for dramatiq worker to auto shutdown if no messages are present in the queue?
I am running some dramatiq as kubernetes jobs. The usecase require the pods to shutdown if no messages are in the queue. So what I need is that the dramatiq worker process shutsdown if not messages are in the queue.
Is it possible to do that in…

Saurabh Saxena
- 1,327
- 2
- 13
- 26
1
vote
0 answers
Python Dramatiq - Accessing message id from actor method
How can I access message id from within the actor method? I want to see which id is getting processed for logging purpose
@dramatiq.actor
def fn(x, y):
# log the message id
return x+y

learningisfun
- 131
- 1
- 5
1
vote
1 answer
python dramatiq wait until compete
I'm using dramatiq with flask. In dramatiq i have a function which send files to google drive. but there is an issue.
if i call dramatiq function only one time and wait for result by myself until all files is delivered to google drive it is ok.
But…

dmitriy_one
- 477
- 1
- 5
- 16
1
vote
1 answer
Dramatiq execute many times a task
I'm currently running on docker-compose on an 8 core instance (docker_serivce, dramatiq_service, rabbitmq_service, postgres_service, etc):
django_apscheduler==0.5.2
dramatiq [rabbitmq, watch]==1.8.1
RabbitMQ (rabbitmq: 3.8-management-alpine…

Rodrigo Suarez
- 184
- 6
1
vote
1 answer
Why is dramatiq detecting my PC as 32 bits?
I'm trying to run django-dramatiq --watch, but it returns a RuntimeError: Watching for source changes is not supported on win32.
django-dramatiq version:
dramatiq version:
Both my Python installation and my system are 64 bits, so I don't…

Kieroth29
- 64
- 2
- 7
1
vote
1 answer
Dramatiq worker getting killed every often
I have started a dramatiq worker to do some task and after a point, it is just stuck and throws this below-mentioned error after some time.
[MainThread] [dramatiq.MainProcess] [CRITICAL] Worker with PID 53 exited unexpectedly (code -9). Shutting…

Sheikh Mannan Sohail
- 11
- 2