Bogdanp / dramatiq

A fast and reliable background task processing library for Python 3.
https://dramatiq.io
GNU Lesser General Public License v3.0
4.37k stars 313 forks source link

StubBroker vs RedisBroker+redislite #58

Closed rpkilby closed 6 years ago

rpkilby commented 6 years ago

During testing, what are the practical differences between the StubBroker and the RedisBroker+redislite?

Bogdanp commented 6 years ago

I've never used redislite (though it looks pretty cool!) so I wouldn't really know. The biggest difference would be that the stub broker doesn't have any dependencies, but they should both behave the same.

I don't think I'd want to replace the stub broker with that combination, however, because it doesn't feel right to force someone who, for example, only uses the RMQ broker to also install Redis if he/she doesn't need it.

rpkilby commented 6 years ago

Definitely agree - the StubBroker is a suitable testing alternative for RMQ users. Mostly just wanted to check if the StubBroker had any behavior differences or additional testing features that I would otherwise miss out on by using redislite.

rpkilby commented 6 years ago

Ah - the RedisBroker does not have the flush and flush_all methods.

Bogdanp commented 6 years ago

Right, but it doesn't really need them since you can just flush Redis directly.

rpkilby commented 6 years ago

That would presume that the user is familiar with redis and knows how to flush dramatiq's queues. Also, from a testing perspective the consistency would be helpful, as switching brokers wouldn't require rewriting how the broker is flushed.

Bogdanp commented 6 years ago

Makes sense. I opened https://github.com/Bogdanp/dramatiq/issues/62 to track that as an enhancement.