On Fri, Oct 26, 2012 at 7:49 PM, Yury Selivanov <yselivanov.ml@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) any deferred:

d = deferred_returning_expression
reactor.callLater(timeout, d.cancel)

Where deferred_returning_expression can be anything, including calling your @inlineCallbacks-decorated function.

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.

 
-
Yury
--
cheers
lvh