Exemple #1
0
    def append(self, data):
        """\
        Appends item to the list, or raises Axon.AxonExceptions.noSpaceInBox
        exception if the number of items already meets the size limit.

        Calls self.notify() callback
        """
        if self.showtransit or ShowAllTransits:
            print "Delivery via [", self.tag, "] of ", repr(data)
        if self.size is not None:
            if len(self) >= self.size:
                raise noSpaceInBox(len(self), self.size)
        list.append(self, data)
        self.notify()
Exemple #2
0
    def append(self,data):
        """\
        Appends item to the list, or raises Axon.AxonExceptions.noSpaceInBox
        exception if the number of items already meets the size limit.

        Calls self.notify() callback
        """
        if self.showtransit or ShowAllTransits:
            print "Delivery via [", self.tag, "] of ", repr(data)
        if self.size is not None:
           if len(self) >= self.size:
               raise noSpaceInBox(len(self),self.size)
        list.append(self,data)
        self.notify()
   def send(self,message, boxname="outbox"):
       """\
       appends message to the requested outbox.

       Used by the main() method to send a message to the outside world.
       All comms goes via a named box/output queue

       You will want to call this method to send messages.
       
       Raises Axon.AxonExceptions.noSpaceInBox if this outbox is linked to a
       destination inbox that is full, or if your component is producing messages
       faster than Axon can pass them on.

       You are unlikely to want to override this method.
       """
       try:
           self.outqueues[boxname].put_nowait(message)
           # wake up _localmain() so it can collect the message and send it on
           Component.component.unpause(self)        # FIXME: Fragile
       except Queue.Full:
           raise noSpaceInBox(self.outqueues[boxname].qsize(), self.queuelengths)
   def send(self,message, boxname="outbox"):
       """\
       appends message to the requested outbox.

       Used by the main() method to send a message to the outside world.
       All comms goes via a named box/output queue

       You will want to call this method to send messages.
       
       Raises Axon.AxonExceptions.noSpaceInBox if this outbox is linked to a
       destination inbox that is full, or if your component is producing messages
       faster than Axon can pass them on.

       You are unlikely to want to override this method.
       """
       try:
           self.outqueues[boxname].put_nowait(message)
           # wake up _localmain() so it can collect the message and send it on
           Component.component.unpause(self)        # FIXME: Fragile
       except Queue.Full:
           raise noSpaceInBox(self.outqueues[boxname].qsize(), self.queuelengths)