Closed wwarne closed 1 year ago
Hi and thanks for raising this issue.
This is a normal behavior, because that's how redis PUBSUB works.
You can read more here: https://redis.io/docs/manual/pubsub/
If you want to execute one tasks in a time, consider using rabbitmq broken instead.
Thank you!
What about using Redis Streams?
UPD: BRPOP may be a better solution. The disadvantage of using Stream is that it stores processed messages, in this application this functionality is not needed.
@booqoffsky, hi. It might be a good solution, indeed. I guess we need to transfer this issue to taskiq-redis and add RedisStreamBroker.
Hi, @wwarne! Please check out our new release 0.2.0. Thanks to @booqoffsky now we have a new broker that runs as you expect, without broadcasting messages. Sorry so it took so long, but we made huge improvements in taskiq internals.
If it works for you, please mark issue as resolved.
I checked it and everything works great! Thank you a lot guys, you are amazing!
It seems like broker just runs a task in every available worker process.
Here is simple example based on docs.
broker.py
taskiq worker broker:broker --workers=5
(it's 2 by default)Log from workers:
So it has been executed 5 times.
Probably it's not desired especially if task is using a lot of recourses or sending some emails.
Am I doing something wrong?