Add framework for additional worker docs.
Adds an "about" page as well as a code walkthrough page with some initial content.
This commit is contained in:
parent
8168268f20
commit
3c1dddb59d
27
doc/worker/about.rst
Normal file
27
doc/worker/about.rst
Normal file
@ -0,0 +1,27 @@
|
||||
Description
|
||||
===========
|
||||
|
||||
Purpose
|
||||
-------
|
||||
|
||||
The Libra Gearman worker does cool stuff.
|
||||
|
||||
Design
|
||||
------
|
||||
|
||||
The design rocks.
|
||||
|
||||
Gearman Messages
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Yup, we got 'em.
|
||||
|
||||
Pluggable Drivers
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
HAProxy is one.
|
||||
|
||||
HAProxy OS Support
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Only Ubuntu now, but designed for others to be easily implemented.
|
34
doc/worker/code.rst
Normal file
34
doc/worker/code.rst
Normal file
@ -0,0 +1,34 @@
|
||||
Code Walkthrough
|
||||
================
|
||||
|
||||
Here we'll highlight some of the more important code aspects.
|
||||
|
||||
Gearman Task
|
||||
------------
|
||||
.. py:module:: libra.worker.worker
|
||||
|
||||
.. py:function:: lbaas_task(worker, job)
|
||||
|
||||
This is the function executed by the Gearman worker for each message
|
||||
retrieved from a Gearman job server.
|
||||
|
||||
Server Class
|
||||
------------
|
||||
|
||||
.. py:module:: libra.worker.worker
|
||||
|
||||
.. py:class:: Server(logger, servers, reconnect_sleep)
|
||||
|
||||
This class encapsulates the server activity once it starts in either
|
||||
daemon or non-daemon mode and all configuration options are read.
|
||||
|
||||
.. py:method:: main()
|
||||
|
||||
The one and only method in the class and represents the primary
|
||||
function of the program. The Gearman worker is started in this method,
|
||||
which then executes the :py:func:`lbaas_task` function for each message.
|
||||
It does not exit unless the worker itself exits.
|
||||
|
||||
If all Gearman job servers become unavailable, the worker would
|
||||
normally exit. This method identifies that situation and periodically
|
||||
attempts to restart the worker in an endless loop.
|
@ -4,4 +4,6 @@ Libra Gearman Worker
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
config
|
||||
about
|
||||
config
|
||||
code
|
Loading…
x
Reference in New Issue
Block a user