projects
/
pyrabbit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df284bf
)
Incremental delay when receiving messages (better performance)
master
author
Javier Sancho
<jsf@jsancho.org>
Wed, 30 Oct 2013 14:25:15 +0000
(15:25 +0100)
committer
Javier Sancho
<jsf@jsancho.org>
Wed, 30 Oct 2013 14:25:15 +0000
(15:25 +0100)
pyrabbit.py
patch
|
blob
|
history
diff --git
a/pyrabbit.py
b/pyrabbit.py
index dfb9ac8f797051d6ad373962a89390c1ab85f48b..351e98d6d39994afe7ce3271ae8a952b901740f7 100644
(file)
--- a/
pyrabbit.py
+++ b/
pyrabbit.py
@@
-57,8
+57,11
@@
class Connection(object):
t_start = time.time()
method = None
i = 0
+ delay = 0.0
while method is None and (time.time()-t_start < timeout or timeout <= 0):
- time.sleep(0.1)
+ time.sleep(delay)
+ if delay < 1:
+ delay += 0.01
method, properties, body = self.channel.basic_get(queues[i])
if i == len(queues) - 1:
i = 0