celery.result.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Task Result - celery.result &mdash; Celery v0.2.0-pre1 documentation</title>
  7. <link rel="stylesheet" href="../static/default.css" type="text/css" />
  8. <link rel="stylesheet" href="../static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '../',
  12. VERSION: '0.2.0-pre1',
  13. COLLAPSE_MODINDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="../static/jquery.js"></script>
  19. <script type="text/javascript" src="../static/doctools.js"></script>
  20. <link rel="top" title="Celery v0.2.0-pre1 documentation" href="../index.html" />
  21. <link rel="next" title="Task Registry - celery.registry" href="celery.registry.html" />
  22. <link rel="prev" title="Tasks - celery.task" href="celery.task.html" />
  23. </head>
  24. <body>
  25. <div class="related">
  26. <h3>Navigation</h3>
  27. <ul>
  28. <li class="right" style="margin-right: 10px">
  29. <a href="../genindex.html" title="General Index"
  30. accesskey="I">index</a></li>
  31. <li class="right" >
  32. <a href="../modindex.html" title="Global Module Index"
  33. accesskey="M">modules</a> |</li>
  34. <li class="right" >
  35. <a href="celery.registry.html" title="Task Registry - celery.registry"
  36. accesskey="N">next</a> |</li>
  37. <li class="right" >
  38. <a href="celery.task.html" title="Tasks - celery.task"
  39. accesskey="P">previous</a> |</li>
  40. <li><a href="../index.html">Celery v0.2.0-pre1 documentation</a> &raquo;</li>
  41. </ul>
  42. </div>
  43. <div class="document">
  44. <div class="documentwrapper">
  45. <div class="bodywrapper">
  46. <div class="body">
  47. <div class="section" id="module-celery.result">
  48. <h1>Task Result - celery.result<a class="headerlink" href="#module-celery.result" title="Permalink to this headline">¶</a></h1>
  49. <p>Asynchronous result types.</p>
  50. <dl class="class">
  51. <dt id="celery.result.AsyncResult">
  52. <em class="property">
  53. class </em><tt class="descclassname">celery.result.</tt><tt class="descname">AsyncResult</tt><big>(</big><em>task_id</em><big>)</big><a class="headerlink" href="#celery.result.AsyncResult" title="Permalink to this definition">¶</a></dt>
  54. <dd><p>Pending task result using the default backend.</p>
  55. <dl class="attribute">
  56. <dt id="celery.result.AsyncResult.task_id">
  57. <tt class="descname">task_id</tt><a class="headerlink" href="#celery.result.AsyncResult.task_id" title="Permalink to this definition">¶</a></dt>
  58. <dd>The unique identifier for this task.</dd></dl>
  59. <dl class="attribute">
  60. <dt id="celery.result.AsyncResult.backend">
  61. <tt class="descname">backend</tt><a class="headerlink" href="#celery.result.AsyncResult.backend" title="Permalink to this definition">¶</a></dt>
  62. <dd>Instance of <a title="celery.backends.DefaultBackend" class="reference external" href="celery.backends.html#celery.backends.DefaultBackend"><tt class="xref docutils literal"><span class="pre">celery.backends.DefaultBackend</span></tt></a>.</dd></dl>
  63. </dd></dl>
  64. <dl class="class">
  65. <dt id="celery.result.BaseAsyncResult">
  66. <em class="property">
  67. class </em><tt class="descclassname">celery.result.</tt><tt class="descname">BaseAsyncResult</tt><big>(</big><em>task_id</em>, <em>backend</em><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult" title="Permalink to this definition">¶</a></dt>
  68. <dd><p>Base class for pending result, takes <tt class="docutils literal"><span class="pre">backend</span></tt> argument.</p>
  69. <dl class="attribute">
  70. <dt id="celery.result.BaseAsyncResult.task_id">
  71. <tt class="descname">task_id</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.task_id" title="Permalink to this definition">¶</a></dt>
  72. <dd>The unique identifier for this task.</dd></dl>
  73. <dl class="attribute">
  74. <dt id="celery.result.BaseAsyncResult.backend">
  75. <tt class="descname">backend</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.backend" title="Permalink to this definition">¶</a></dt>
  76. <dd>The task result backend used.</dd></dl>
  77. <dl class="method">
  78. <dt id="celery.result.BaseAsyncResult.get">
  79. <tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.get" title="Permalink to this definition">¶</a></dt>
  80. <dd>Alias to <a title="celery.result.BaseAsyncResult.wait" class="reference internal" href="#celery.result.BaseAsyncResult.wait"><tt class="xref docutils literal"><span class="pre">wait()</span></tt></a>.</dd></dl>
  81. <dl class="method">
  82. <dt id="celery.result.BaseAsyncResult.is_done">
  83. <tt class="descname">is_done</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.is_done" title="Permalink to this definition">¶</a></dt>
  84. <dd><p>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if the task executed successfully.</p>
  85. <table class="docutils field-list" frame="void" rules="none">
  86. <col class="field-name" />
  87. <col class="field-body" />
  88. <tbody valign="top">
  89. <tr class="field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </dd></dl>
  94. <dl class="method">
  95. <dt id="celery.result.BaseAsyncResult.ready">
  96. <tt class="descname">ready</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.ready" title="Permalink to this definition">¶</a></dt>
  97. <dd><p>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if the task executed successfully, or raised
  98. an exception. If the task is still pending, or is waiting for retry
  99. then <tt class="xref docutils literal"><span class="pre">False</span></tt> is returned.</p>
  100. <table class="docutils field-list" frame="void" rules="none">
  101. <col class="field-name" />
  102. <col class="field-body" />
  103. <tbody valign="top">
  104. <tr class="field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. </dd></dl>
  109. <dl class="attribute">
  110. <dt id="celery.result.BaseAsyncResult.result">
  111. <tt class="descname">result</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.result" title="Permalink to this definition">¶</a></dt>
  112. <dd><p>When the task is executed, this contains the return value.</p>
  113. <p>If the task resulted in failure, this will be the exception instance
  114. raised.</p>
  115. </dd></dl>
  116. <dl class="attribute">
  117. <dt id="celery.result.BaseAsyncResult.status">
  118. <tt class="descname">status</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.status" title="Permalink to this definition">¶</a></dt>
  119. <dd><p>The current status of the task.</p>
  120. <p>Can be one of the following:</p>
  121. <blockquote>
  122. <p><em>PENDING</em></p>
  123. <blockquote>
  124. The task is waiting for execution.</blockquote>
  125. <p><em>RETRY</em></p>
  126. <blockquote>
  127. The task is to be retried, possibly because of failure.</blockquote>
  128. <p><em>FAILURE</em></p>
  129. <blockquote>
  130. The task raised an exception, or has been retried more times
  131. than its limit. The <a title="celery.result.BaseAsyncResult.result" class="reference internal" href="#celery.result.BaseAsyncResult.result"><tt class="xref docutils literal"><span class="pre">result</span></tt></a> attribute contains the
  132. exception raised.</blockquote>
  133. <p><em>DONE</em></p>
  134. <blockquote>
  135. The task executed successfully. The <a title="celery.result.BaseAsyncResult.result" class="reference internal" href="#celery.result.BaseAsyncResult.result"><tt class="xref docutils literal"><span class="pre">result</span></tt></a> attribute
  136. contains the resulting value.</blockquote>
  137. </blockquote>
  138. </dd></dl>
  139. <dl class="method">
  140. <dt id="celery.result.BaseAsyncResult.successful">
  141. <tt class="descname">successful</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.successful" title="Permalink to this definition">¶</a></dt>
  142. <dd>Alias to <a title="celery.result.BaseAsyncResult.is_done" class="reference internal" href="#celery.result.BaseAsyncResult.is_done"><tt class="xref docutils literal"><span class="pre">is_done()</span></tt></a>.</dd></dl>
  143. <dl class="method">
  144. <dt id="celery.result.BaseAsyncResult.wait">
  145. <tt class="descname">wait</tt><big>(</big><em>timeout=None</em><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.wait" title="Permalink to this definition">¶</a></dt>
  146. <dd><p>Wait for task, and return the result when it arrives.</p>
  147. <table class="docutils field-list" frame="void" rules="none">
  148. <col class="field-name" />
  149. <col class="field-body" />
  150. <tbody valign="top">
  151. <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>timeout</em> &#8211; How long to wait in seconds, before the
  152. operation times out.</td>
  153. </tr>
  154. <tr class="field"><th class="field-name" colspan="2">Raises <a title="celery.timer.TimeoutError" class="reference external" href="celery.timer.html#celery.timer.TimeoutError">celery.timer.TimeoutError</a>:</th></tr>
  155. <tr><td>&nbsp;</td><td class="field-body">if <tt class="docutils literal"><span class="pre">timeout</span></tt> is not <tt class="xref docutils literal"><span class="pre">None</span></tt> and
  156. the result does not arrive within <tt class="docutils literal"><span class="pre">timeout</span></tt> seconds.</td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <p>If the remote call raised an exception then that
  161. exception will be re-raised.</p>
  162. </dd></dl>
  163. </dd></dl>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="sphinxsidebar">
  169. <div class="sphinxsidebarwrapper">
  170. <h4>Previous topic</h4>
  171. <p class="topless"><a href="celery.task.html"
  172. title="previous chapter">Tasks - celery.task</a></p>
  173. <h4>Next topic</h4>
  174. <p class="topless"><a href="celery.registry.html"
  175. title="next chapter">Task Registry - celery.registry</a></p>
  176. <h3>This Page</h3>
  177. <ul class="this-page-menu">
  178. <li><a href="../sources/reference/celery.result.txt"
  179. rel="nofollow">Show Source</a></li>
  180. </ul>
  181. <div id="searchbox" style="display: none">
  182. <h3>Quick search</h3>
  183. <form class="search" action="../search.html" method="get">
  184. <input type="text" name="q" size="18" />
  185. <input type="submit" value="Go" />
  186. <input type="hidden" name="check_keywords" value="yes" />
  187. <input type="hidden" name="area" value="default" />
  188. </form>
  189. <p class="searchtip" style="font-size: 90%">
  190. Enter search terms or a module, class or function name.
  191. </p>
  192. </div>
  193. <script type="text/javascript">$('#searchbox').show(0);</script>
  194. </div>
  195. </div>
  196. <div class="clearer"></div>
  197. </div>
  198. <div class="related">
  199. <h3>Navigation</h3>
  200. <ul>
  201. <li class="right" style="margin-right: 10px">
  202. <a href="../genindex.html" title="General Index"
  203. >index</a></li>
  204. <li class="right" >
  205. <a href="../modindex.html" title="Global Module Index"
  206. >modules</a> |</li>
  207. <li class="right" >
  208. <a href="celery.registry.html" title="Task Registry - celery.registry"
  209. >next</a> |</li>
  210. <li class="right" >
  211. <a href="celery.task.html" title="Tasks - celery.task"
  212. >previous</a> |</li>
  213. <li><a href="../index.html">Celery v0.2.0-pre1 documentation</a> &raquo;</li>
  214. </ul>
  215. </div>
  216. <div class="footer">
  217. &copy; Copyright 2009, Ask Solem.
  218. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
  219. </div>
  220. </body>
  221. </html>