Skip to content
Permalink
Browse files

rebuild pages at 3923027 on branch 9.0

  • Loading branch information...
guewen committed Jul 2, 2019
1 parent dfc7776 commit 45e7dafb4c0de4b3f03cea14ea9dab51e56e31b0
Binary file not shown.
Binary file not shown.
BIN +5.68 KB (100%) 9.0/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

@@ -257,7 +257,7 @@ <h1>Queue<a class="headerlink" href="#queue" title="Permalink to this headline">
<span id="job"></span><h2>Job<a class="headerlink" href="#module-connector.queue.job" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="connector.queue.job.Job">
<em class="property">class </em><code class="descclassname">connector.queue.job.</code><code class="descname">Job</code><span class="sig-paren">(</span><em>func=None</em>, <em>model_name=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>priority=None</em>, <em>eta=None</em>, <em>job_uuid=None</em>, <em>max_retries=None</em>, <em>description=None</em>, <em>channel=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#Job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.Job" title="Permalink to this definition">¶</a></dt>
<em class="property">class </em><code class="descclassname">connector.queue.job.</code><code class="descname">Job</code><span class="sig-paren">(</span><em>func=None</em>, <em>model_name=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>priority=None</em>, <em>eta=None</em>, <em>job_uuid=None</em>, <em>max_retries=None</em>, <em>description=None</em>, <em>channel=None</em>, <em>identity_key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#Job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.Job" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A Job is a task to execute.</p>
<dl class="attribute">
@@ -412,6 +412,11 @@ <h1>Queue<a class="headerlink" href="#queue" title="Permalink to this headline">
<code class="descname">func_string</code></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="connector.queue.job.Job.identity_key">
<code class="descname">identity_key</code><a class="headerlink" href="#connector.queue.job.Job.identity_key" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="connector.queue.job.Job.perform">
<code class="descname">perform</code><span class="sig-paren">(</span><em>session</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#Job.perform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.Job.perform" title="Permalink to this definition">¶</a></dt>
@@ -515,7 +520,7 @@ <h1>Queue<a class="headerlink" href="#queue" title="Permalink to this headline">

<dl class="method">
<dt id="connector.queue.job.OpenERPJobStorage.enqueue">
<code class="descname">enqueue</code><span class="sig-paren">(</span><em>func</em>, <em>model_name=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>priority=None</em>, <em>eta=None</em>, <em>max_retries=None</em>, <em>description=None</em>, <em>channel=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#OpenERPJobStorage.enqueue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.OpenERPJobStorage.enqueue" title="Permalink to this definition">¶</a></dt>
<code class="descname">enqueue</code><span class="sig-paren">(</span><em>func</em>, <em>model_name=None</em>, <em>args=None</em>, <em>kwargs=None</em>, <em>priority=None</em>, <em>eta=None</em>, <em>max_retries=None</em>, <em>description=None</em>, <em>channel=None</em>, <em>identity_key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#OpenERPJobStorage.enqueue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.OpenERPJobStorage.enqueue" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a Job and enqueue it in the queue. Return the job uuid.</p>
<p>This expects the arguments specific to the job to be already extracted
from the ones to pass to the job function.</p>
@@ -533,6 +538,12 @@ <h1>Queue<a class="headerlink" href="#queue" title="Permalink to this headline">
<dd><p>Returns if a job still exists in the storage.</p>
</dd></dl>

<dl class="method">
<dt id="connector.queue.job.OpenERPJobStorage.job_record_with_same_identity_key">
<code class="descname">job_record_with_same_identity_key</code><span class="sig-paren">(</span><em>identity_key</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#OpenERPJobStorage.job_record_with_same_identity_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.OpenERPJobStorage.job_record_with_same_identity_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if a job to be executed with the same key exists.</p>
</dd></dl>

<dl class="method">
<dt id="connector.queue.job.OpenERPJobStorage.load">
<code class="descname">load</code><span class="sig-paren">(</span><em>job_uuid</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#OpenERPJobStorage.load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.OpenERPJobStorage.load" title="Permalink to this definition">¶</a></dt>
@@ -547,6 +558,37 @@ <h1>Queue<a class="headerlink" href="#queue" title="Permalink to this headline">

</dd></dl>

<dl class="function">
<dt id="connector.queue.job.identity_exact">
<code class="descclassname">connector.queue.job.</code><code class="descname">identity_exact</code><span class="sig-paren">(</span><em>job_</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#identity_exact"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.identity_exact" title="Permalink to this definition">¶</a></dt>
<dd><p>Identity function using the model, method and all arguments as key
When used, this identity key will have the effect that when a job should be
created and a pending job with the exact same recordset and arguments, the
second will not be created.
It should be used with the <code class="docutils literal notranslate"><span class="pre">identity_key</span></code> argument:
.. python:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">odoo.addons.connector.queue.job</span> <span class="k">import</span> <span class="n">identity_exact</span>
<span class="c1"># [...]</span>
<span class="n">my_delayable_export_record_method</span><span class="o">.</span><span class="n">delay</span><span class="p">(</span>
<span class="n">session</span><span class="p">,</span> <span class="s2">&quot;my.model&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">force</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">identity_key</span><span class="o">=</span><span class="n">identity_exact</span><span class="p">)</span>
</pre></div>
</div>
<p>Alternative identity keys can be built using the various fields of the job.
For example, you could compute a hash using only some arguments of
the job.
.. python:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">identity_example</span><span class="p">(</span><span class="n">job_</span><span class="p">):</span>
<span class="n">hasher</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha1</span><span class="p">()</span>
<span class="n">hasher</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">job_</span><span class="o">.</span><span class="n">args</span><span class="p">))</span>
<span class="n">hasher</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">job_</span><span class="o">.</span><span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;foo&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)))</span>
<span class="k">return</span> <span class="n">hasher</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span>
</pre></div>
</div>
<p>Usually you will probably always want to include at least the name of the
model and method.</p>
</dd></dl>

<dl class="function">
<dt id="connector.queue.job.job">
<code class="descclassname">connector.queue.job.</code><code class="descname">job</code><span class="sig-paren">(</span><em>func=None</em>, <em>default_channel='root'</em>, <em>retry_pattern=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/connector/queue/job.html#job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#connector.queue.job.job" title="Permalink to this definition">¶</a></dt>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN -179 Bytes (100%) 9.0/fr/.doctrees/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 45e7daf

Please sign in to comment.
You can’t perform that action at this time.