~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-31 00:26:32 UTC
  • mfrom: (14606.4.19 apocaremains-2)
  • Revision ID: launchpad@pqm.canonical.com-20111231002632-67fafhhz150cct3b
[r=wgrant][no-qa] Explode canonical.lazr.

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()