~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/webapp/doc/timeout.txt

  • Committer: William Grant
  • Date: 2011-12-30 08:13:14 UTC
  • mto: This revision was merged to the branch mainline in revision 14611.
  • Revision ID: william.grant@canonical.com-20111230081314-f73f4ozgkzdi5xqb
More stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
functions wrapped with the @with_timeout decorator) that computes the
9
9
time remaining before the request should time out.
10
10
 
11
 
    >>> from canonical.lazr.timeout import get_default_timeout_function
 
11
    >>> from lp.services.timeout import get_default_timeout_function
12
12
    >>> from lp.services.webapp.adapter import (
13
13
    ...     set_launchpad_default_timeout)
14
14
    >>> old_func = get_default_timeout_function()
56
56
 
57
57
Same thing if a function decorated using @with_timeout is called.
58
58
 
59
 
    >>> from canonical.lazr.timeout import with_timeout
 
59
    >>> from lp.services.timeout import with_timeout
60
60
    >>> @with_timeout()
61
61
    ... def wait_a_little():
62
62
    ...     time.sleep(1)
117
117
 
118
118
    >>> ignored = config.pop('timeout')
119
119
 
120
 
    >>> from canonical.lazr.timeout import set_default_timeout_function
 
120
    >>> from lp.services.timeout import set_default_timeout_function
121
121
    >>> set_default_timeout_function(old_func)
122
122
 
123
123
    >>> clear_request_started()