celery.datastructures.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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>Datastructures - celery.datastructures &mdash; Celery v0.1.15 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.1.15',
  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.1.15 documentation" href="../index.html" />
  21. <link rel="next" title="Logging - celery.log" href="celery.log.html" />
  22. <link rel="prev" title="Configuration - celery.conf" href="celery.conf.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.log.html" title="Logging - celery.log"
  36. accesskey="N">next</a> |</li>
  37. <li class="right" >
  38. <a href="celery.conf.html" title="Configuration - celery.conf"
  39. accesskey="P">previous</a> |</li>
  40. <li><a href="../index.html">Celery v0.1.15 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.datastructures">
  48. <h1>Datastructures - celery.datastructures<a class="headerlink" href="#module-celery.datastructures" title="Permalink to this headline">¶</a></h1>
  49. <p>Custom Datastructures</p>
  50. <dl class="class">
  51. <dt id="celery.datastructures.PositionQueue">
  52. <em class="property">
  53. class </em><tt class="descclassname">celery.datastructures.</tt><tt class="descname">PositionQueue</tt><big>(</big><em>length</em><big>)</big><a class="headerlink" href="#celery.datastructures.PositionQueue" title="Permalink to this definition">¶</a></dt>
  54. <dd><p>A positional queue of a specific length, with slots that are either
  55. filled or unfilled. When all of the positions are filled, the queue
  56. is considered <a title="celery.datastructures.PositionQueue.full" class="reference internal" href="#celery.datastructures.PositionQueue.full"><tt class="xref docutils literal"><span class="pre">full()</span></tt></a>.</p>
  57. <table class="docutils field-list" frame="void" rules="none">
  58. <col class="field-name" />
  59. <col class="field-body" />
  60. <tbody valign="top">
  61. <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>length</em> &#8211; The number of items required for the queue to be filled.</td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. <dl class="class">
  66. <dt id="celery.datastructures.PositionQueue.UnfilledPosition">
  67. <em class="property">
  68. class </em><tt class="descname">UnfilledPosition</tt><big>(</big><em>position</em><big>)</big><a class="headerlink" href="#celery.datastructures.PositionQueue.UnfilledPosition" title="Permalink to this definition">¶</a></dt>
  69. <dd>Describes an unfilled slot.</dd></dl>
  70. <dl class="attribute">
  71. <dt id="celery.datastructures.PositionQueue.filled">
  72. <tt class="descclassname">PositionQueue.</tt><tt class="descname">filled</tt><a class="headerlink" href="#celery.datastructures.PositionQueue.filled" title="Permalink to this definition">¶</a></dt>
  73. <dd>Returns the filled slots as a list.</dd></dl>
  74. <dl class="method">
  75. <dt id="celery.datastructures.PositionQueue.full">
  76. <tt class="descclassname">PositionQueue.</tt><tt class="descname">full</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.datastructures.PositionQueue.full" title="Permalink to this definition">¶</a></dt>
  77. <dd>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if all of the slots has been filled.</dd></dl>
  78. </dd></dl>
  79. <dl class="class">
  80. <dt id="celery.datastructures.TaskProcessQueue">
  81. <em class="property">
  82. class </em><tt class="descclassname">celery.datastructures.</tt><tt class="descname">TaskProcessQueue</tt><big>(</big><em>limit</em>, <em>logger=None</em>, <em>done_msg=None</em><big>)</big><a class="headerlink" href="#celery.datastructures.TaskProcessQueue" title="Permalink to this definition">¶</a></dt>
  83. <dd><p>Queue of running child processes, which starts waiting for the
  84. processes to finish when the queue limit is reached.</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">Parameters:</th><td class="field-body"><ul class="first last simple">
  90. <li><em>limit</em> &#8211; see <a title="celery.datastructures.TaskProcessQueue.limit" class="reference internal" href="#celery.datastructures.TaskProcessQueue.limit"><tt class="xref docutils literal"><span class="pre">limit</span></tt></a> attribute.</li>
  91. <li><em>logger</em> &#8211; see <a title="celery.datastructures.TaskProcessQueue.logger" class="reference internal" href="#celery.datastructures.TaskProcessQueue.logger"><tt class="xref docutils literal"><span class="pre">logger</span></tt></a> attribute.</li>
  92. <li><em>done_msg</em> &#8211; see <a title="celery.datastructures.TaskProcessQueue.done_msg" class="reference internal" href="#celery.datastructures.TaskProcessQueue.done_msg"><tt class="xref docutils literal"><span class="pre">done_msg</span></tt></a> attribute.</li>
  93. </ul>
  94. </td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. <dl class="attribute">
  99. <dt id="celery.datastructures.TaskProcessQueue.limit">
  100. <tt class="descname">limit</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.limit" title="Permalink to this definition">¶</a></dt>
  101. <dd>The number of processes that can run simultaneously until
  102. we start collecting results.</dd></dl>
  103. <dl class="attribute">
  104. <dt id="celery.datastructures.TaskProcessQueue.logger">
  105. <tt class="descname">logger</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.logger" title="Permalink to this definition">¶</a></dt>
  106. <dd>The logger used to print the <a title="celery.datastructures.TaskProcessQueue.done_msg" class="reference internal" href="#celery.datastructures.TaskProcessQueue.done_msg"><tt class="xref docutils literal"><span class="pre">done_msg</span></tt></a>.</dd></dl>
  107. <dl class="attribute">
  108. <dt id="celery.datastructures.TaskProcessQueue.done_msg">
  109. <tt class="descname">done_msg</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.done_msg" title="Permalink to this definition">¶</a></dt>
  110. <dd>Message logged when a tasks result has been collected.
  111. The message is logged with loglevel <tt class="xref docutils literal"><span class="pre">logging.INFO</span></tt>.</dd></dl>
  112. <dl class="method">
  113. <dt id="celery.datastructures.TaskProcessQueue.add">
  114. <tt class="descname">add</tt><big>(</big><em>result</em>, <em>task_name</em>, <em>task_id</em><big>)</big><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.add" title="Permalink to this definition">¶</a></dt>
  115. <dd><p>Add a process to the queue.</p>
  116. <p>If the queue is full, it will start to collect return values from
  117. the tasks executed. When all return values has been collected,
  118. it deletes the current queue and is ready to accept new processes.</p>
  119. <table class="docutils field-list" frame="void" rules="none">
  120. <col class="field-name" />
  121. <col class="field-body" />
  122. <tbody valign="top">
  123. <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  124. <li><em>result</em> &#8211; A <tt class="xref docutils literal"><span class="pre">multiprocessing.AsyncResult</span></tt> instance, as
  125. returned by <tt class="xref docutils literal"><span class="pre">multiprocessing.Pool.apply_async()</span></tt>.</li>
  126. <li><em>task_name</em> &#8211; Name of the task executed.</li>
  127. <li><em>task_id</em> &#8211; Id of the task executed.</li>
  128. </ul>
  129. </td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. </dd></dl>
  134. </dd></dl>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="sphinxsidebar">
  140. <div class="sphinxsidebarwrapper">
  141. <h4>Previous topic</h4>
  142. <p class="topless"><a href="celery.conf.html"
  143. title="previous chapter">Configuration - celery.conf</a></p>
  144. <h4>Next topic</h4>
  145. <p class="topless"><a href="celery.log.html"
  146. title="next chapter">Logging - celery.log</a></p>
  147. <h3>This Page</h3>
  148. <ul class="this-page-menu">
  149. <li><a href="../sources/reference/celery.datastructures.txt"
  150. rel="nofollow">Show Source</a></li>
  151. </ul>
  152. <div id="searchbox" style="display: none">
  153. <h3>Quick search</h3>
  154. <form class="search" action="../search.html" method="get">
  155. <input type="text" name="q" size="18" />
  156. <input type="submit" value="Go" />
  157. <input type="hidden" name="check_keywords" value="yes" />
  158. <input type="hidden" name="area" value="default" />
  159. </form>
  160. <p class="searchtip" style="font-size: 90%">
  161. Enter search terms or a module, class or function name.
  162. </p>
  163. </div>
  164. <script type="text/javascript">$('#searchbox').show(0);</script>
  165. </div>
  166. </div>
  167. <div class="clearer"></div>
  168. </div>
  169. <div class="related">
  170. <h3>Navigation</h3>
  171. <ul>
  172. <li class="right" style="margin-right: 10px">
  173. <a href="../genindex.html" title="General Index"
  174. >index</a></li>
  175. <li class="right" >
  176. <a href="../modindex.html" title="Global Module Index"
  177. >modules</a> |</li>
  178. <li class="right" >
  179. <a href="celery.log.html" title="Logging - celery.log"
  180. >next</a> |</li>
  181. <li class="right" >
  182. <a href="celery.conf.html" title="Configuration - celery.conf"
  183. >previous</a> |</li>
  184. <li><a href="../index.html">Celery v0.1.15 documentation</a> &raquo;</li>
  185. </ul>
  186. </div>
  187. <div class="footer">
  188. &copy; Copyright 2009, Ask Solem.
  189. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
  190. </div>
  191. </body>
  192. </html>