I am working on a Zope product that throws data into a queue that is monitored
by a number (3) of producers. Producers can talk to Corba objects. I use
omniOrb for this. Producers take out data from the outqueue and send it to other
Corba objects. This is the basic setup:

class SIPConnector(SimpleItem):
     """Connector class"""

   def __init__(self, id, title):
      self.id = id
      self.title = title
      self.n = 3    # number of producers

   def initConnectionPool(self):
      self._v_outqueue = Queue.Queue()

      for i in range(self.n):
         id = 'tc' + str(i)
         tp = SIPProducer(id)
         thread.start_new_thread(self.runProducer, (tc, self._v_outqueue,))

   def post(self, sid, to, msg):
      self._v_outqueue.put(sid, to, msg)

   def runProducer(self, tp, oq):
      # connect to Corba dispatcher
      tp.orb, tp.cmf = tp._connect()
      while 1:
            msg = oq.get(0)
            print msg
         except Queue.Empty:

class SIPProducer(CorbaBaseClass):
   def __init__(self, id):
      self.id = id

This basically works. However, if I put msg's in the queue with the post method from a 
page template, and I do this a couple of times, quickly, I get an attribute error on 
self._v_inqueue. It is somehow gets lost. Does anyone know what I am doing wrong here? 
What happened to the 'lost' queue?



Brain, v. [as in "to brain"]:
        To rebuke bluntly, but not pointedly; to dispel a source of
error in an opponent.
                -- Ambrose Bierce, "The Devil's Dictionary"

Joost van Lawick van Pabst
W: http://www.lawick.nl/

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to