| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">  <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <title>Datastructures - celery.datastructures — Celery v0.2.0-pre2 documentation</title>    <link rel="stylesheet" href="../static/default.css" type="text/css" />    <link rel="stylesheet" href="../static/pygments.css" type="text/css" />    <script type="text/javascript">      var DOCUMENTATION_OPTIONS = {        URL_ROOT:    '../',        VERSION:     '0.2.0-pre2',        COLLAPSE_MODINDEX: false,        FILE_SUFFIX: '.html',        HAS_SOURCE:  true      };    </script>    <script type="text/javascript" src="../static/jquery.js"></script>    <script type="text/javascript" src="../static/doctools.js"></script>    <link rel="top" title="Celery v0.2.0-pre2 documentation" href="../index.html" />    <link rel="next" title="Logging - celery.log" href="celery.log.html" />    <link rel="prev" title="Configuration - celery.conf" href="celery.conf.html" />   </head>  <body>    <div class="related">      <h3>Navigation</h3>      <ul>        <li class="right" style="margin-right: 10px">          <a href="../genindex.html" title="General Index"             accesskey="I">index</a></li>        <li class="right" >          <a href="../modindex.html" title="Global Module Index"             accesskey="M">modules</a> |</li>        <li class="right" >          <a href="celery.log.html" title="Logging - celery.log"             accesskey="N">next</a> |</li>        <li class="right" >          <a href="celery.conf.html" title="Configuration - celery.conf"             accesskey="P">previous</a> |</li>        <li><a href="../index.html">Celery v0.2.0-pre2 documentation</a> »</li>       </ul>    </div>      <div class="document">      <div class="documentwrapper">        <div class="bodywrapper">          <div class="body">              <div class="section" id="module-celery.datastructures"><h1>Datastructures - celery.datastructures<a class="headerlink" href="#module-celery.datastructures" title="Permalink to this headline">¶</a></h1><p>Custom Datastructures</p><dl class="class"><dt id="celery.datastructures.PositionQueue"><em class="property">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><dd><p>A positional queue of a specific length, with slots that are eitherfilled or unfilled. When all of the positions are filled, the queueis 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><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>length</em> – The number of items required for the queue to be filled.</td></tr></tbody></table><dl class="class"><dt id="celery.datastructures.PositionQueue.UnfilledPosition"><em class="property">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><dd>Describes an unfilled slot.</dd></dl><dl class="attribute"><dt id="celery.datastructures.PositionQueue.filled"><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><dd>Returns the filled slots as a list.</dd></dl><dl class="method"><dt id="celery.datastructures.PositionQueue.full"><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><dd>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if all of the slots has been filled.</dd></dl></dd></dl><dl class="class"><dt id="celery.datastructures.TaskProcessQueue"><em class="property">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><dd><p>Queue of running child processes, which starts waiting for theprocesses to finish when the queue limit is reached.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><em>limit</em> – 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><li><em>logger</em> – 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><li><em>done_msg</em> – 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></ul></td></tr></tbody></table><dl class="attribute"><dt id="celery.datastructures.TaskProcessQueue.limit"><tt class="descname">limit</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.limit" title="Permalink to this definition">¶</a></dt><dd>The number of processes that can run simultaneously untilwe start collecting results.</dd></dl><dl class="attribute"><dt id="celery.datastructures.TaskProcessQueue.logger"><tt class="descname">logger</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.logger" title="Permalink to this definition">¶</a></dt><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><dl class="attribute"><dt id="celery.datastructures.TaskProcessQueue.done_msg"><tt class="descname">done_msg</tt><a class="headerlink" href="#celery.datastructures.TaskProcessQueue.done_msg" title="Permalink to this definition">¶</a></dt><dd>Message logged when a tasks result has been collected.The message is logged with loglevel <tt class="xref docutils literal"><span class="pre">logging.INFO</span></tt>.</dd></dl><dl class="method"><dt id="celery.datastructures.TaskProcessQueue.add"><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><dd><p>Add a process to the queue.</p><p>If the queue is full, it will start to collect return values fromthe tasks executed. When all return values has been collected,it deletes the current queue and is ready to accept new processes.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><em>result</em> – A <tt class="xref docutils literal"><span class="pre">multiprocessing.AsyncResult</span></tt> instance, asreturned by <tt class="xref docutils literal"><span class="pre">multiprocessing.Pool.apply_async()</span></tt>.</li><li><em>task_name</em> – Name of the task executed.</li><li><em>task_id</em> – Id of the task executed.</li></ul></td></tr></tbody></table></dd></dl></dd></dl></div>          </div>        </div>      </div>      <div class="sphinxsidebar">        <div class="sphinxsidebarwrapper">            <h4>Previous topic</h4>            <p class="topless"><a href="celery.conf.html"                                  title="previous chapter">Configuration - celery.conf</a></p>            <h4>Next topic</h4>            <p class="topless"><a href="celery.log.html"                                  title="next chapter">Logging - celery.log</a></p>            <h3>This Page</h3>            <ul class="this-page-menu">              <li><a href="../sources/reference/celery.datastructures.txt"                     rel="nofollow">Show Source</a></li>            </ul>          <div id="searchbox" style="display: none">            <h3>Quick search</h3>              <form class="search" action="../search.html" method="get">                <input type="text" name="q" size="18" />                <input type="submit" value="Go" />                <input type="hidden" name="check_keywords" value="yes" />                <input type="hidden" name="area" value="default" />              </form>              <p class="searchtip" style="font-size: 90%">              Enter search terms or a module, class or function name.              </p>          </div>          <script type="text/javascript">$('#searchbox').show(0);</script>        </div>      </div>      <div class="clearer"></div>    </div>    <div class="related">      <h3>Navigation</h3>      <ul>        <li class="right" style="margin-right: 10px">          <a href="../genindex.html" title="General Index"             >index</a></li>        <li class="right" >          <a href="../modindex.html" title="Global Module Index"             >modules</a> |</li>        <li class="right" >          <a href="celery.log.html" title="Logging - celery.log"             >next</a> |</li>        <li class="right" >          <a href="celery.conf.html" title="Configuration - celery.conf"             >previous</a> |</li>        <li><a href="../index.html">Celery v0.2.0-pre2 documentation</a> »</li>       </ul>    </div>    <div class="footer">      © Copyright 2009, Ask Solem.      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.    </div>  </body></html>
 |