diff --git a/experiments/python/hop/queue.py b/experiments/python/hop/queue.py index 5519a62..323f485 100644 --- a/experiments/python/hop/queue.py +++ b/experiments/python/hop/queue.py @@ -15,6 +15,9 @@ ## You should have received a copy of the GNU General Public License ## along with Hop. If not, see . +from __future__ import with_statement + +import logging import threading import Queue as builtin_Queue @@ -27,11 +30,12 @@ Q = builtin_Queue.Queue class Queue(dispatch.HopNode): def __init__(self, arg): + self.name = arg[0] self.backlog = Q() self.waiters = Q() self.thread = threading.Thread(target = self.queue_main) self.thread.start() - if not namespace.bind(arg[0], self): + if not namespace.bind(self.name, self): raise Exception("duplicate name") def node_info(self):