celery.pool.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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 Pool - celery.pool &mdash; Celery v0.4.2 (stable) documentation</title>
  7. <link rel="stylesheet" href="../static/nature.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.4.2 (stable)',
  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.4.2 (stable) documentation" href="../index.html" />
  21. <link rel="up" title="Module API Reference" href="index.html" />
  22. <link rel="next" title="Process Supervisor - celery.supervisor" href="celery.supervisor.html" />
  23. <link rel="prev" title="Worker Controller Threads - celery.worker.controllers" href="celery.worker.controllers.html" />
  24. </head>
  25. <body>
  26. <div class="related">
  27. <h3>Navigation</h3>
  28. <ul>
  29. <li class="right" style="margin-right: 10px">
  30. <a href="../genindex.html" title="General Index"
  31. accesskey="I">index</a></li>
  32. <li class="right" >
  33. <a href="../modindex.html" title="Global Module Index"
  34. accesskey="M">modules</a> |</li>
  35. <li class="right" >
  36. <a href="celery.supervisor.html" title="Process Supervisor - celery.supervisor"
  37. accesskey="N">next</a> |</li>
  38. <li class="right" >
  39. <a href="celery.worker.controllers.html" title="Worker Controller Threads - celery.worker.controllers"
  40. accesskey="P">previous</a> |</li>
  41. <li><a href="../index.html">Celery v0.4.2 (stable) documentation</a> &raquo;</li>
  42. <li><a href="index.html" accesskey="U">Module API Reference</a> &raquo;</li>
  43. </ul>
  44. </div>
  45. <div class="document">
  46. <div class="documentwrapper">
  47. <div class="bodywrapper">
  48. <div class="body">
  49. <div class="section" id="module-celery.pool">
  50. <h1>Task Pool - celery.pool<a class="headerlink" href="#module-celery.pool" title="Permalink to this headline">¶</a></h1>
  51. <p>Process Pools.</p>
  52. <dl class="class">
  53. <dt id="celery.pool.TaskPool">
  54. <em class="property">
  55. class </em><tt class="descclassname">celery.pool.</tt><tt class="descname">TaskPool</tt><big>(</big><em>limit</em>, <em>logger=None</em><big>)</big><a class="headerlink" href="#celery.pool.TaskPool" title="Permalink to this definition">¶</a></dt>
  56. <dd><p>Process Pool for processing tasks in parallel.</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">Parameters:</th><td class="field-body"><ul class="first last simple">
  62. <li><em>limit</em> &#8211; see <a title="celery.pool.TaskPool.limit" class="reference internal" href="#celery.pool.TaskPool.limit"><tt class="xref docutils literal"><span class="pre">limit</span></tt></a> attribute.</li>
  63. <li><em>logger</em> &#8211; see <a title="celery.pool.TaskPool.logger" class="reference internal" href="#celery.pool.TaskPool.logger"><tt class="xref docutils literal"><span class="pre">logger</span></tt></a> attribute.</li>
  64. </ul>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <dl class="attribute">
  70. <dt id="celery.pool.TaskPool.limit">
  71. <tt class="descname">limit</tt><a class="headerlink" href="#celery.pool.TaskPool.limit" title="Permalink to this definition">¶</a></dt>
  72. <dd>The number of processes that can run simultaneously.</dd></dl>
  73. <dl class="attribute">
  74. <dt id="celery.pool.TaskPool.logger">
  75. <tt class="descname">logger</tt><a class="headerlink" href="#celery.pool.TaskPool.logger" title="Permalink to this definition">¶</a></dt>
  76. <dd>The logger used for debugging.</dd></dl>
  77. <dl class="method">
  78. <dt id="celery.pool.TaskPool.apply_async">
  79. <tt class="descname">apply_async</tt><big>(</big><em>target</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>callbacks=None</em>, <em>errbacks=None</em>, <em>meta=None</em><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.apply_async" title="Permalink to this definition">¶</a></dt>
  80. <dd><p>Equivalent of the :func:<tt class="docutils literal"><span class="pre">apply</span></tt> built-in function.</p>
  81. <p>All <tt class="docutils literal"><span class="pre">callbacks</span></tt> and <tt class="docutils literal"><span class="pre">errbacks</span></tt> should complete immediately since
  82. otherwise the thread which handles the result will get blocked.</p>
  83. </dd></dl>
  84. <dl class="method">
  85. <dt id="celery.pool.TaskPool.full">
  86. <tt class="descname">full</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.full" title="Permalink to this definition">¶</a></dt>
  87. <dd><p>Is the pool full?</p>
  88. <table class="docutils field-list" frame="void" rules="none">
  89. <col class="field-name" />
  90. <col class="field-body" />
  91. <tbody valign="top">
  92. <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><tt class="xref docutils literal"><span class="pre">True</span></tt> if the maximum number of concurrent processes
  93. has been reached.</td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </dd></dl>
  98. <dl class="method">
  99. <dt id="celery.pool.TaskPool.get_worker_pids">
  100. <tt class="descname">get_worker_pids</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.get_worker_pids" title="Permalink to this definition">¶</a></dt>
  101. <dd>Returns the process id&#8217;s of all the pool workers.</dd></dl>
  102. <dl class="method">
  103. <dt id="celery.pool.TaskPool.on_ready">
  104. <tt class="descname">on_ready</tt><big>(</big><em>callbacks</em>, <em>errbacks</em>, <em>meta</em>, <em>ret_value</em><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.on_ready" title="Permalink to this definition">¶</a></dt>
  105. <dd>What to do when a worker task is ready and its return value has
  106. been collected.</dd></dl>
  107. <dl class="method">
  108. <dt id="celery.pool.TaskPool.on_return">
  109. <tt class="descname">on_return</tt><big>(</big><em>tid</em>, <em>callbacks</em>, <em>errbacks</em>, <em>meta</em>, <em>ret_value</em><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.on_return" title="Permalink to this definition">¶</a></dt>
  110. <dd>What to do when the process returns.</dd></dl>
  111. <dl class="method">
  112. <dt id="celery.pool.TaskPool.start">
  113. <tt class="descname">start</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.start" title="Permalink to this definition">¶</a></dt>
  114. <dd><p>Run the task pool.</p>
  115. <p>Will pre-fork all workers so they&#8217;re ready to accept tasks.</p>
  116. </dd></dl>
  117. <dl class="method">
  118. <dt id="celery.pool.TaskPool.stop">
  119. <tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.pool.TaskPool.stop" title="Permalink to this definition">¶</a></dt>
  120. <dd>Terminate the pool.</dd></dl>
  121. </dd></dl>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="sphinxsidebar">
  127. <div class="sphinxsidebarwrapper">
  128. <h4>Previous topic</h4>
  129. <p class="topless"><a href="celery.worker.controllers.html"
  130. title="previous chapter">Worker Controller Threads - celery.worker.controllers</a></p>
  131. <h4>Next topic</h4>
  132. <p class="topless"><a href="celery.supervisor.html"
  133. title="next chapter">Process Supervisor - celery.supervisor</a></p>
  134. <h3>This Page</h3>
  135. <ul class="this-page-menu">
  136. <li><a href="../sources/reference/celery.pool.txt"
  137. rel="nofollow">Show Source</a></li>
  138. </ul>
  139. <div id="searchbox" style="display: none">
  140. <h3>Quick search</h3>
  141. <form class="search" action="../search.html" method="get">
  142. <input type="text" name="q" size="18" />
  143. <input type="submit" value="Go" />
  144. <input type="hidden" name="check_keywords" value="yes" />
  145. <input type="hidden" name="area" value="default" />
  146. </form>
  147. <p class="searchtip" style="font-size: 90%">
  148. Enter search terms or a module, class or function name.
  149. </p>
  150. </div>
  151. <script type="text/javascript">$('#searchbox').show(0);</script>
  152. </div>
  153. </div>
  154. <div class="clearer"></div>
  155. </div>
  156. <div class="related">
  157. <h3>Navigation</h3>
  158. <ul>
  159. <li class="right" style="margin-right: 10px">
  160. <a href="../genindex.html" title="General Index"
  161. >index</a></li>
  162. <li class="right" >
  163. <a href="../modindex.html" title="Global Module Index"
  164. >modules</a> |</li>
  165. <li class="right" >
  166. <a href="celery.supervisor.html" title="Process Supervisor - celery.supervisor"
  167. >next</a> |</li>
  168. <li class="right" >
  169. <a href="celery.worker.controllers.html" title="Worker Controller Threads - celery.worker.controllers"
  170. >previous</a> |</li>
  171. <li><a href="../index.html">Celery v0.4.2 (stable) documentation</a> &raquo;</li>
  172. <li><a href="index.html" >Module API Reference</a> &raquo;</li>
  173. </ul>
  174. </div>
  175. <div class="footer">
  176. &copy; Copyright 2009, Ask Solem.
  177. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
  178. </div>
  179. </body>
  180. </html>