On Wed, 2008-03-19 at 16:45 +0100, Dirk Meyer wrote:
> + def trigger():
> + self.disconnect(async.finish)
> + self.exception.disconnect(async.throw)
> + if not async._finished:
> + if callback:
> + callback()
> + async.throw(TimeoutException, TimeoutException('timeout'),
> None)
> + async.link(self)
> + OneShotTimer(trigger).start(timeout)
> + return async
Since we're throwing a TimeoutException through the new InProgress, is
callback really needed? Couldn't the caller just connect to the
exception member of the new IP object? This also then gives the chance
to suppress the exception output, since it would be handled.
In other words, instead of:
def timeout_handler(*args):
print "Async call timed out"
return False
do_something_async().timeout(5, timeout_handler).connect(result_handler)
You'd do:
do_something_async().timeout(5).connect_both(result_handler,
timeout_handler)
And in this case, timeout_handler could prevent an unhandled
TimeoutException dump.
-------------------------------------------------------------------------
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