On 10/10/2009 12:43, Michael Sparks wrote:
> On Thursday 08 October 2009 14:28:58 Jim Easterbrook wrote:
>
>> Here's my solution (tested) which I think achieves the same thing:
>>
>> class ConsumerT(Axon.ThreadedComponent.threadedcomponent):
>> def main(self):
>> count = 0
>> while 1:
>> if self.dataReady('inbox'):
>> msg = self.recv('inbox')
>> count += 1
>> elif self.dataReady('control'):
>> self.sync()
>> if not self.dataReady('inbox'):
>> msg = self.recv('control')
>> if isinstance(msg, producerFinished):
>> break
>> else:
>> self.pause(0.1)
>> print "%d messages received" % count
>
> That would work, but from a performance perspective, it's a huge hit on the
> system.
True, but (in my application) only when a component is being shut down.
I don't use signal/control for anything else. I'm not suggesting it is
applicable more generally.
> It's a bug in Axon IMO, thanks for discussing it here :-)
I didn't expect to start such a long thread, let alone trigger a code
rewrite.
--
Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"kamaelia" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/kamaelia?hl=en
-~----------~----~----~----~------~----~------~--~---