Created
December 10, 2014 13:59
-
-
Save public/f3fd19bd542d795ff3b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PrefetchBatches(batches.Batches): | |
def Strategy(self, task, app, consumer): | |
handler = super(PrefetchBatches, self).Strategy(task, app, consumer) | |
def task_handler(*args, **kwargs): | |
if consumer.qos.value < self.flush_every: | |
diff = self.flush_every - consumer.qos.value | |
consumer.qos.increment_eventually(diff) | |
return handler(*args, **kwargs) | |
return task_handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment