celery.result.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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-pre3 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-pre3',
  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-pre3 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-pre3 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. <table class="docutils field-list" frame="void" rules="none">
  56. <col class="field-name" />
  57. <col class="field-body" />
  58. <tbody valign="top">
  59. <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>task_id</em> &#8211; see <a title="celery.result.AsyncResult.task_id" class="reference internal" href="#celery.result.AsyncResult.task_id"><tt class="xref docutils literal"><span class="pre">task_id</span></tt></a>.</td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. <dl class="attribute">
  64. <dt id="celery.result.AsyncResult.task_id">
  65. <tt class="descname">task_id</tt><a class="headerlink" href="#celery.result.AsyncResult.task_id" title="Permalink to this definition">¶</a></dt>
  66. <dd>The unique identifier for this task.</dd></dl>
  67. <dl class="attribute">
  68. <dt id="celery.result.AsyncResult.backend">
  69. <tt class="descname">backend</tt><a class="headerlink" href="#celery.result.AsyncResult.backend" title="Permalink to this definition">¶</a></dt>
  70. <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>
  71. </dd></dl>
  72. <dl class="class">
  73. <dt id="celery.result.BaseAsyncResult">
  74. <em class="property">
  75. 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>
  76. <dd><p>Base class for pending result, supports custom
  77. task meta <a title="celery.result.BaseAsyncResult.backend" class="reference internal" href="#celery.result.BaseAsyncResult.backend"><tt class="xref docutils literal"><span class="pre">backend</span></tt></a></p>
  78. <table class="docutils field-list" frame="void" rules="none">
  79. <col class="field-name" />
  80. <col class="field-body" />
  81. <tbody valign="top">
  82. <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  83. <li><em>task_id</em> &#8211; see <a title="celery.result.BaseAsyncResult.task_id" class="reference internal" href="#celery.result.BaseAsyncResult.task_id"><tt class="xref docutils literal"><span class="pre">task_id</span></tt></a>.</li>
  84. <li><em>backend</em> &#8211; see <a title="celery.result.BaseAsyncResult.backend" class="reference internal" href="#celery.result.BaseAsyncResult.backend"><tt class="xref docutils literal"><span class="pre">backend</span></tt></a>.</li>
  85. </ul>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. <dl class="attribute">
  91. <dt id="celery.result.BaseAsyncResult.task_id">
  92. <tt class="descname">task_id</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.task_id" title="Permalink to this definition">¶</a></dt>
  93. <dd>The unique identifier for this task.</dd></dl>
  94. <dl class="attribute">
  95. <dt id="celery.result.BaseAsyncResult.backend">
  96. <tt class="descname">backend</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.backend" title="Permalink to this definition">¶</a></dt>
  97. <dd>The task result backend used.</dd></dl>
  98. <dl class="method">
  99. <dt id="celery.result.BaseAsyncResult.get">
  100. <tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.get" title="Permalink to this definition">¶</a></dt>
  101. <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>
  102. <dl class="method">
  103. <dt id="celery.result.BaseAsyncResult.is_done">
  104. <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>
  105. <dd><p>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if the task executed successfully.</p>
  106. <table class="docutils field-list" frame="void" rules="none">
  107. <col class="field-name" />
  108. <col class="field-body" />
  109. <tbody valign="top">
  110. <tr class="field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. </dd></dl>
  115. <dl class="method">
  116. <dt id="celery.result.BaseAsyncResult.ready">
  117. <tt class="descname">ready</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.ready" title="Permalink to this definition">¶</a></dt>
  118. <dd><p>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if the task executed successfully, or raised
  119. an exception. If the task is still pending, or is waiting for retry
  120. then <tt class="xref docutils literal"><span class="pre">False</span></tt> is returned.</p>
  121. <table class="docutils field-list" frame="void" rules="none">
  122. <col class="field-name" />
  123. <col class="field-body" />
  124. <tbody valign="top">
  125. <tr class="field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. </dd></dl>
  130. <dl class="attribute">
  131. <dt id="celery.result.BaseAsyncResult.result">
  132. <tt class="descname">result</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.result" title="Permalink to this definition">¶</a></dt>
  133. <dd><p>When the task has been executed, this contains the return value.</p>
  134. <p>If the task raised an exception, this will be the exception instance.</p>
  135. </dd></dl>
  136. <dl class="attribute">
  137. <dt id="celery.result.BaseAsyncResult.status">
  138. <tt class="descname">status</tt><a class="headerlink" href="#celery.result.BaseAsyncResult.status" title="Permalink to this definition">¶</a></dt>
  139. <dd><p>The current status of the task.</p>
  140. <p>Can be one of the following:</p>
  141. <blockquote>
  142. <p><em>PENDING</em></p>
  143. <blockquote>
  144. The task is waiting for execution.</blockquote>
  145. <p><em>RETRY</em></p>
  146. <blockquote>
  147. The task is to be retried, possibly because of failure.</blockquote>
  148. <p><em>FAILURE</em></p>
  149. <blockquote>
  150. The task raised an exception, or has been retried more times
  151. 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
  152. exception raised.</blockquote>
  153. <p><em>DONE</em></p>
  154. <blockquote>
  155. 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
  156. contains the resulting value.</blockquote>
  157. </blockquote>
  158. </dd></dl>
  159. <dl class="method">
  160. <dt id="celery.result.BaseAsyncResult.successful">
  161. <tt class="descname">successful</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.result.BaseAsyncResult.successful" title="Permalink to this definition">¶</a></dt>
  162. <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>
  163. <dl class="method">
  164. <dt id="celery.result.BaseAsyncResult.wait">
  165. <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>
  166. <dd><p>Wait for task, and return the result when it arrives.</p>
  167. <table class="docutils field-list" frame="void" rules="none">
  168. <col class="field-name" />
  169. <col class="field-body" />
  170. <tbody valign="top">
  171. <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
  172. operation times out.</td>
  173. </tr>
  174. <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>
  175. <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
  176. the result does not arrive within <tt class="docutils literal"><span class="pre">timeout</span></tt> seconds.</td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. <p>If the remote call raised an exception then that
  181. exception will be re-raised.</p>
  182. </dd></dl>
  183. </dd></dl>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="sphinxsidebar">
  189. <div class="sphinxsidebarwrapper">
  190. <h4>Previous topic</h4>
  191. <p class="topless"><a href="celery.task.html"
  192. title="previous chapter">Tasks - celery.task</a></p>
  193. <h4>Next topic</h4>
  194. <p class="topless"><a href="celery.registry.html"
  195. title="next chapter">Task Registry - celery.registry</a></p>
  196. <h3>This Page</h3>
  197. <ul class="this-page-menu">
  198. <li><a href="../sources/reference/celery.result.txt"
  199. rel="nofollow">Show Source</a></li>
  200. </ul>
  201. <div id="searchbox" style="display: none">
  202. <h3>Quick search</h3>
  203. <form class="search" action="../search.html" method="get">
  204. <input type="text" name="q" size="18" />
  205. <input type="submit" value="Go" />
  206. <input type="hidden" name="check_keywords" value="yes" />
  207. <input type="hidden" name="area" value="default" />
  208. </form>
  209. <p class="searchtip" style="font-size: 90%">
  210. Enter search terms or a module, class or function name.
  211. </p>
  212. </div>
  213. <script type="text/javascript">$('#searchbox').show(0);</script>
  214. </div>
  215. </div>
  216. <div class="clearer"></div>
  217. </div>
  218. <div class="related">
  219. <h3>Navigation</h3>
  220. <ul>
  221. <li class="right" style="margin-right: 10px">
  222. <a href="../genindex.html" title="General Index"
  223. >index</a></li>
  224. <li class="right" >
  225. <a href="../modindex.html" title="Global Module Index"
  226. >modules</a> |</li>
  227. <li class="right" >
  228. <a href="celery.registry.html" title="Task Registry - celery.registry"
  229. >next</a> |</li>
  230. <li class="right" >
  231. <a href="celery.task.html" title="Tasks - celery.task"
  232. >previous</a> |</li>
  233. <li><a href="../index.html">Celery v0.2.0-pre3 documentation</a> &raquo;</li>
  234. </ul>
  235. </div>
  236. <div class="footer">
  237. &copy; Copyright 2009, Ask Solem.
  238. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
  239. </div>
  240. </body>
  241. </html>