On Wed, 2008-01-16 at 12:01 +0100, Dirk Meyer wrote:
> attached a patch how I think a BackgroundTask should look like. I
> added BackgroundTask to async.py and use it in Process and
> Thread. Tell me what you think.

Ok, will have a look some time today.


> On a site-notice: We have Thread() that has a start() function. This
> class calls a function in a new thread. This class is a
> BackgroundTask. On the other side we have ThreadCallback which has a
> register function to schedule the task in a thread with a given
> name. This object is an InProgress object. This is confusing. First of
> all ThreadCallback should be a BackgroundTask _having_ an InProgress
> object. I also think 'register' should be called 'schedule' or even
> better, try to merge Thread and ThreadCallback.

As I understand what you wrote, it sounds ok to me.  I've never used
ThreadCallback so I don't know why you would use it over Thread.  If
they basically do the same thing, let's merge them.


> And why do we call MainThreadCallback using __call__? OK, we do the
> same for Callback, but MainThreadCallback takes some time. Maybe the
> function should be called start, too.

IMHO anything with 'Callback' in the name must be callable.  In
particular the cool thing about MainThreadCallback is that now we have a
callable that will execute in the mainthread.  We can pass this to
anything that accepts a callable, notably signal.connect.  I understand
the logic behind your suggestion but I think it makes _more_ sense for
MainThreadCallback to behave like the other Callback classes, which it
does, which is good. :)

Jason.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to