Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Aug 17, 2024
1 parent a4fd7a0 commit c9be3b4
Show file tree
Hide file tree
Showing 19 changed files with 561 additions and 21 deletions.
5 changes: 3 additions & 2 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; stiqueue 1.0.5 documentation</title>
<title>Overview: module code &#8212; stiqueue 1.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=039e1c02" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=f7257fce"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=7a812f30"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../genindex.html" />
Expand Down Expand Up @@ -52,6 +52,7 @@ <h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../stiqueue.html">stiqueue package</a></li>
<li class="toctree-l1"><a class="reference internal" href="../examples.html">Examples</a></li>
</ul>

<div class="relations">
Expand Down
5 changes: 3 additions & 2 deletions docs/_modules/stiqueue/sqclient.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>stiqueue.sqclient &#8212; stiqueue 1.0.5 documentation</title>
<title>stiqueue.sqclient &#8212; stiqueue 1.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=039e1c02" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=f7257fce"></script>
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=7a812f30"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
Expand Down Expand Up @@ -210,6 +210,7 @@ <h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../stiqueue.html">stiqueue package</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../examples.html">Examples</a></li>
</ul>

<div class="relations">
Expand Down
5 changes: 3 additions & 2 deletions docs/_modules/stiqueue/sqserver.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>stiqueue.sqserver &#8212; stiqueue 1.0.5 documentation</title>
<title>stiqueue.sqserver &#8212; stiqueue 1.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=039e1c02" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=f7257fce"></script>
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js?v=7a812f30"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="../../genindex.html" />
Expand Down Expand Up @@ -241,6 +241,7 @@ <h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../stiqueue.html">stiqueue package</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../examples.html">Examples</a></li>
</ul>

<div class="relations">
Expand Down
12 changes: 12 additions & 0 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _examples:

Examples
========

.. toctree::
:maxdepth: 1

examples/client_example.rst
examples/server_example.rst


54 changes: 54 additions & 0 deletions docs/_sources/examples/client_example.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

Client Example
==============

.. code-block:: python
import logging
from stiqueue.sqclient import SQClient
class SQClient2(SQClient):
def rev(self):
msg = self.send_with_action(msg=b"", action=b"deq", recv=True)
msg = msg.decode()
return msg[::-1]
def get_logger():
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
logger.addHandler(ch)
return logger
def main(logger=None):
if logger is None:
logger = get_logger()
p1 = SQClient2()
p2 = SQClient2()
p1.enq(b"P1> This is message one")
p1.enq(b"P2> This is message two")
p2.enq(b"P2> This is message three")
logger.debug("get from P1: ")
msg = p1.deq()
logger.debug(f"msg1: {msg}")
msg = p1.rev()
logger.debug(f"msg2 rev: {msg}")
logger.debug("get from P2: ")
msg = p2.rev()
logger.debug(f"msg3 rev: {msg}")
msg = p2.deq()
logger.debug(f"msg P2: (should be empty) = {msg}")
msg = p1.deq()
logger.debug(f"msg P1: (should be empty) = {msg}")
if __name__ == '__main__':
main()
35 changes: 35 additions & 0 deletions docs/_sources/examples/server_example.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

Server Example
==============

.. code-block:: python
from stiqueue.sqserver import SQServer
class SQServer2(SQServer):
def other_actions(self, action_msg):
action = action_msg[:self.action_len]
if len(action_msg) >= self.action_len:
msg = action_msg[self.action_len:]
if action == b"rev":
self.enq(msg[::-1])
elif action == b"prt":
self.logger.debug("printing the queue: ")
for i, msg in enumerate(self.q):
self.logger.debug("q(%d)> %s" % (i, msg))
else:
self.logger.error("ERROR: invalid action:")
self.logger.error(action_msg)
self.logger.error(action)
else:
self.logger.error("Error: invalid action length:")
self.logger.error(action_msg)
self.logger.error(action)
if __name__ == '__main__':
server = SQServer2()
server.listen()
4 changes: 3 additions & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. stiqueue documentation master file, created by
sphinx-quickstart on Sat Aug 17 15:43:44 2024.
sphinx-quickstart on Sat Aug 17 17:34:12 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Expand All @@ -14,6 +14,8 @@ Welcome to stiqueue's documentation!

stiqueue

examples

Indices and tables
==================

Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.0.5',
VERSION: '1.1.1',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
118 changes: 118 additions & 0 deletions docs/examples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Examples &#8212; stiqueue 1.1.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=039e1c02" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js?v=7a812f30"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=4825356b"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Client Example" href="examples/client_example.html" />
<link rel="prev" title="stiqueue package" href="stiqueue.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />


<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

</head><body>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">


<div class="body" role="main">

<section id="examples">
<span id="id1"></span><h1>Examples<a class="headerlink" href="#examples" title="Permalink to this heading"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="examples/client_example.html">Client Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples/server_example.html">Server Example</a></li>
</ul>
</div>
</section>


</div>

</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">stiqueue</a></h1>








<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="stiqueue.html">stiqueue package</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples/client_example.html">Client Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples/server_example.html">Server Example</a></li>
</ul>
</li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="stiqueue.html" title="previous chapter">stiqueue package</a></li>
<li>Next: <a href="examples/client_example.html" title="next chapter">Client Example</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>








</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2024, Ahmad Alobaid.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 7.1.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

|
<a href="_sources/examples.rst.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
Loading

0 comments on commit c9be3b4

Please sign in to comment.