gem/oq-engine — pull request #828 by larsbutler (2012-07-27 17:23:50+00:00)
Title: Reorganized task queuing

When completion signals are received from workers, the message callback
is now responsible for enqueuing the next task. This helps to keep the
main execution logic more concise. It also makes the code a bit less ambiguous; before, it was not clear whether the call to `conn.drain_events()` would consume only a single message or multiple messages from the queue. This would be a problem if multiple messages are consumed but only a single additional task is enqueued because it could result in idle worker machines. (Checking the documentation revealed that only one message is consumed when `drain_events()` is called, but this reorganization is much easier to follow.)