Created
December 20, 2012 09:28
-
-
Save schmir/4344132 to your computer and use it in GitHub Desktop.
This file contains 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
#! /usr/bin/env python | |
"""reproduce https://github.com/majek/puka/issues/34 | |
starting 2 instances of this program reproduces the error in less than | |
20s on my machine | |
""" | |
import puka, os | |
def doit(name): | |
client = puka.Client() | |
promise = client.connect() | |
client.wait(promise) | |
promise = client.queue_declare(queue=name) | |
client.wait(promise) | |
promise = client.basic_publish(exchange='', routing_key=name, | |
body="xxxxxx") | |
client.wait(promise) | |
consume_promise = client.basic_consume(queue=name) | |
# msg_result = client.wait(consume_promise) | |
promise = client.queue_delete(name) | |
# client.wait(promise) | |
promise = client.close() | |
client.wait(promise) | |
i = 0 | |
while 1: | |
name = "foobar-%s=%s" % (os.getpid(), i) | |
doit(name) | |
i += 1 | |
print i | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment