Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Jan 25, 2025
1 parent 2c708cf commit d0c0b25
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 69 deletions.
17 changes: 15 additions & 2 deletions docs/_modules/stiqueue/sqclient.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ <h1>Source code for stiqueue.sqclient</h1><div class="highlight"><pre>
<span class="sd"> socket (socket.socket): The client socket to communicate with the server.</span>
<span class="sd"> buff_size (int): Buffer size for sending and receiving messages.</span>
<span class="sd"> logger (logging.Logger): Logger for printing messages.</span>
<span class="sd"> ack_required (bool): Indicates whether an acknowledgment is required after the client receives the message.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">buff_size</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">1234</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">buff_size</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ack_required</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initializes the SQClient with the specified parameters.</span>

Expand All @@ -64,9 +65,11 @@ <h1>Source code for stiqueue.sqclient</h1><div class="highlight"><pre>
<span class="sd"> port (int): The port number to connect to the server. Defaults to 1234.</span>
<span class="sd"> logger (logging.Logger, optional): Logger for logging messages. If None, a default logger is created.</span>
<span class="sd"> buff_size (int, optional): Buffer size for sending and receiving messages. Defaults to None.</span>
<span class="sd"> ack_required (bool): Indicates whether an acknowledgment is required after the client receives the message.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">host</span>
<span class="bp">self</span><span class="o">.</span><span class="n">port</span> <span class="o">=</span> <span class="n">port</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ack_required</span> <span class="o">=</span> <span class="n">ack_required</span>
<span class="k">if</span> <span class="n">host</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">gethostname</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">socket</span> <span class="o">=</span> <span class="kc">None</span>
Expand Down Expand Up @@ -149,7 +152,17 @@ <h1>Source code for stiqueue.sqclient</h1><div class="highlight"><pre>
<span class="sd"> Returns:</span>
<span class="sd"> bytes: The dequeued message from the server.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">send_with_action</span><span class="p">(</span><span class="sa">b</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="sa">b</span><span class="s2">&quot;deq&quot;</span><span class="p">,</span> <span class="n">recv</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<span class="n">msg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">send_with_action</span><span class="p">(</span><span class="sa">b</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="sa">b</span><span class="s2">&quot;deq&quot;</span><span class="p">,</span> <span class="n">recv</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ack_required</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ack</span><span class="p">()</span>
<span class="k">return</span> <span class="n">msg</span></div>

<div class="viewcode-block" id="SQClient.ack"><a class="viewcode-back" href="../../stiqueue.html#stiqueue.sqclient.SQClient.ack">[docs]</a> <span class="k">def</span><span class="w"> </span><span class="nf">ack</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Sends an acknowledgement request to the server.</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">send_with_action</span><span class="p">(</span><span class="sa">b</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="sa">b</span><span class="s2">&quot;ack&quot;</span><span class="p">)</span></div>

<div class="viewcode-block" id="SQClient.cnt"><a class="viewcode-back" href="../../stiqueue.html#stiqueue.sqclient.SQClient.cnt">[docs]</a> <span class="k">def</span><span class="w"> </span><span class="nf">cnt</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
Expand Down
15 changes: 14 additions & 1 deletion docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#B"><strong>B</strong></a>
<a href="#A"><strong>A</strong></a>
| <a href="#B"><strong>B</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
Expand All @@ -43,6 +44,18 @@ <h1 id="index">Index</h1>
| <a href="#S"><strong>S</strong></a>

</div>
<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="stiqueue.html#stiqueue.sqclient.SQClient.ack">ack() (stiqueue.sqclient.SQClient method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="stiqueue.html#stiqueue.sqclient.SQClient.ack_required">ack_required (stiqueue.sqclient.SQClient attribute)</a>
</li>
</ul></td>
</tr></table>

<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down
Loading

0 comments on commit d0c0b25

Please sign in to comment.