[Python-ideas] Async API
Laurens Van Houtven
_ at lvh.cc
Sat Oct 27 17:11:33 CEST 2012
On Fri, Oct 26, 2012 at 7:49 PM, Yury Selivanov <yselivanov.ml at gmail.com>wrote:
> If it is decorated, though, how can I invoke it with a timeout?
The important thing to remember is that the fundamental abstraction at play
here is the deferred. Calling such a decorated function gives you a
deferred. So, you call it with a timeout the same way you timeout (cancel)
d = deferred_returning_expression
Where deferred_returning_expression can be anything, including calling your
The way it fits in with all existing stuff, making it look an awful lot
like a lot of existing stuff, is probably why deferred cancellation is one
of the more recent features to make it into twisted: a lot of people did
similar things using the tools that were already there.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas