praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
420 stars 131 forks source link

WorkerHelper should support getting messages after pending deliveries #1008

Closed jerith closed 8 years ago

jerith commented 8 years ago

At the moment, we can either get current messages or wait for a specific number of messages. It would be useful to be able to wait for any pending deliveries to complete and then get whatever messages are available. (This is particularly helpful for #1000, which breaks the assumption that the client can wait for the broker to receive published messages.)

In order to maintain compatibility while avoiding API bloat, I'm making the amount parameter optional in the various WorkerHelper.wait_for_dispatched_* methods and treating a value of None (the default) as an indication that we should wait for pending deliveries to finish instead of waiting for a particular number of messages.

jerith commented 8 years ago

The core change is done, but I also want to update a bunch of tests to use the new functionality as part of this PR.

smn commented 8 years ago

:+1: