Remember queue name

This commit is contained in:
Tony Garnock-Jones 2012-06-01 11:27:27 +01:00
parent 740ef15cbf
commit 00a0049206
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,9 @@
## You should have received a copy of the GNU General Public License
## along with Hop. If not, see <http://www.gnu.org/licenses/>.
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):