~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to doc/howto/defer.html

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-22 22:52:47 UTC
  • Revision ID: james.westby@ubuntu.com-20060222225247-0mjb8ij9473m5zse
Tags: 2.2.0-1ubuntu1
Synchronize with Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
blocking or delayed operations.</p><pre class="python">
25
25
<span class="py-src-keyword">from</span> <span class="py-src-variable">twisted</span>.<span class="py-src-variable">internet</span> <span class="py-src-keyword">import</span> <span class="py-src-variable">reactor</span>, <span class="py-src-variable">defer</span>
26
26
 
27
 
<span class="py-src-keyword">def</span> <span class="py-src-identifier">getDummyData</span>(<span class="py-src-parameter">self</span>, <span class="py-src-parameter">x</span>):
 
27
<span class="py-src-keyword">def</span> <span class="py-src-identifier">getDummyData</span>(<span class="py-src-parameter">x</span>):
28
28
    <span class="py-src-string">&quot;&quot;&quot;
29
29
    This function is a dummy which simulates a delayed result and
30
30
    returns a Deferred which will fire with that result. Don't try too
412
412
  additions to my callback chain do not affect
413
413
  <code>otherDeferred</code></p><p>This is the same as <code class="python">self.addCallbacks(otherDeferred.callback,
414
414
  otherDeferred.errback)</code></p></li></ul><h2>See also<a name="auto12"></a></h2><ol><li><a href="gendefer.html">Generating Deferreds</a>, an introduction to
415
 
writing asynchronous functions that return Deferreds.</li><li><a href="deferrecipes.html">Deferred recipes</a>, a set of recipes using
416
 
Deferreds.</li></ol><h2>Footnotes</h2><ol><li><a name="footnote-1"><span xmlns="http://www.w3.org/1999/xhtml" class="footnote">Unless of course a later callback starts a fresh error &mdash;
 
415
writing asynchronous functions that return Deferreds.</li></ol><h2>Footnotes</h2><ol><li><a name="footnote-1"><span xmlns="http://www.w3.org/1999/xhtml" class="footnote">Unless of course a later callback starts a fresh error &mdash;
417
416
but as we've already noted, adding callbacks to a Deferred after its used in a
418
 
DeferredList is confusing and usually avoided.</span></a></li></ol></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 2.1.0</span></body></html>
 
 
b'\\ No newline at end of file'
 
417
DeferredList is confusing and usually avoided.</span></a></li></ol></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 2.2.0</span></body></html>
 
 
b'\\ No newline at end of file'