[PEAK] subscribable/conditional lists
john at landahl.org
Tue Apr 20 19:22:59 EDT 2004
peak.events could use support for subscribable/conditional lists, which
could be used as an input queue for a Task-based worker loop. Something
like the following:
queue = binding.Make(ConditionalList)
yield self.queue; queue = events.resume()
worker = binding.Make(events.taskFactory(worker), uponAssembly=True)
def addWork(self, data):
The worker should suspend until there's work for it in the queue, at
which point it consumes the data in the queue and waits for more work.
I've come up with a basic implementation (attached); does seem like a
decent approach, or is there a better way to do this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3314 bytes
Desc: not available
Url : http://www.eby-sarna.com/pipermail/peak/attachments/20040420/f5398c02/eventlist.py
More information about the PEAK