On Wed, 2008-03-19 at 16:59 +0100, Dirk Meyer wrote:
> rename class InProgressExecution to def execute (similar to twisted)
I don't think I'm terribly keen on this name. It's a bit generic given
what it does. I'd prefer something that makes it at least clear
something having to do with async is happening. Any such descriptive
name is bound to be uglier, but at least it will be more obvious.
So this calls the function and wraps it in an InProgress object. Maybe
something like wrap_inprogress which is, granted, pretty ugly. :(
Would it be helpful to have a decorator to make sure that anything being
returned by the decorated function is an InProgress object? Then it
could implicitly do what kaa.execute does.
Perhaps wrap_inprogress, or whatever we call it, could double as a
decorator (wouldn't be unprecedented):
@kaa.wrap_inprogress()
def do_something_async(self):
"""
This function always returns InProgress.
"""
if foo:
return self.some_coroutine()
return self.some_normal_function()
-------------------------------------------------------------------------
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-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog