Remember queue name
This commit is contained in:
parent
740ef15cbf
commit
00a0049206
|
@ -15,6 +15,9 @@
|
||||||
## You should have received a copy of the GNU General Public License
|
## You should have received a copy of the GNU General Public License
|
||||||
## along with Hop. If not, see <http://www.gnu.org/licenses/>.
|
## along with Hop. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from __future__ import with_statement
|
||||||
|
|
||||||
|
import logging
|
||||||
import threading
|
import threading
|
||||||
import Queue as builtin_Queue
|
import Queue as builtin_Queue
|
||||||
|
|
||||||
|
@ -27,11 +30,12 @@ Q = builtin_Queue.Queue
|
||||||
|
|
||||||
class Queue(dispatch.HopNode):
|
class Queue(dispatch.HopNode):
|
||||||
def __init__(self, arg):
|
def __init__(self, arg):
|
||||||
|
self.name = arg[0]
|
||||||
self.backlog = Q()
|
self.backlog = Q()
|
||||||
self.waiters = Q()
|
self.waiters = Q()
|
||||||
self.thread = threading.Thread(target = self.queue_main)
|
self.thread = threading.Thread(target = self.queue_main)
|
||||||
self.thread.start()
|
self.thread.start()
|
||||||
if not namespace.bind(arg[0], self):
|
if not namespace.bind(self.name, self):
|
||||||
raise Exception("duplicate name")
|
raise Exception("duplicate name")
|
||||||
|
|
||||||
def node_info(self):
|
def node_info(self):
|
||||||
|
|
Loading…
Reference in New Issue