queue: Use normal instance data in SimpleQueue

Code like this is dangerous:

    class SimpleQueue(object):
        queues = set()

because all instances will share the same 'queues' set object.

We don't really need multiple instances, but neither is there a reason to break
them.  So do the normal Python thing instead.

(imported from commit a56bb8414dd549cfd312c9565df198cf9d20f08a)
This commit is contained in:
Keegan McAllister 2013-01-17 17:07:10 -05:00
parent f14db52f22
commit b2bc7941dc
1 changed files with 4 additions and 6 deletions

View File

@ -7,13 +7,11 @@ import simplejson
# interface for external files to put things into queues and take them # interface for external files to put things into queues and take them
# out from bots without having to import pika code all over our codebase. # out from bots without having to import pika code all over our codebase.
class SimpleQueueClient(object): class SimpleQueueClient(object):
connection = None
channel = None
queues = set()
_inited = False
def __init__(self): def __init__(self):
pass self.connection = None
self.channel = None
self.queues = set()
self._inited = False
def initialize(self): def initialize(self):
# Initialize the connection # Initialize the connection