How to create a queue with a fixed size?



How can one create a blocking queue behavior with dramatiq? The motivation is that we would like to limit the amount of msgs for a certain queue to not be larger than a certain threshold such that producers will be blocked until consumers will process some of them.

Thank you


You might be able to simulate this using the rate limiters that dramatiq gives you, but there’s no specific support for anything like this right now. Note that, if you’re using RMQ as your broker, it already will automatically manage backpressure via its flow control feature.