Dirk Meyer wrote: >> While we're breaking stuff, we should look at unifying the API for async >> status/exception handling between Thread and InProgress. They both >> essentially serve the same purpose: perform some task in the >> "background" (for certain definitions of background) and return either >> the status or an exception asynchronously. > > For Thread and InProgress? They ARE different. Thread is something you > start, just like Process. So these two should be similar. InProgress > is a way of telling you that something eeds more time. I like the idea > of InProgress beeing a Signal, not having one. A Thread on the other > hand is not in progress / running if you create it, you have to > start() it. So start should return an InProgress object. The same for > Process.
I just looked at the code again. We have: Process, Thread and ThreadCallback. When you create the object, nothing happens. All these classes have a run/register function. So what about: class BackgroundObject(object): def __init__(self): self.signals = kaa.Signals('completed', 'exception') def _started(self): async = kaa.InProgress connected to self.signals return async class Process/Thread/ThreadCallback(BackgroundObject): def start/register(self, ...): async = self._started() do_stuff return async Dischi -- You can rent this space for only $5 a week.
pgpUKUhyPw6z2.pgp
Description: PGP signature
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel