From c8095cb6994e06119b5e922eb8323e18cda0cc4a Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Mon, 6 Jul 2015 11:11:22 +0200 Subject: [PATCH] Added intersphinx to Python Added cluster class reference --- docs/cluster.rst | 62 +++++++++++++++++++++++++++++++++++++++++++++++- docs/conf.py | 4 ++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/docs/cluster.rst b/docs/cluster.rst index e027002..8cb39d5 100644 --- a/docs/cluster.rst +++ b/docs/cluster.rst @@ -132,4 +132,64 @@ Afterwards the sentinel waits for the monitor to empty the result queue before t - Wait for monitor to stop .. warning:: - If you force the cluster to terminate before the stop procedure has completed, you can lose tasks and their results. \ No newline at end of file + If you force the cluster to terminate before the stop procedure has completed, you can lose tasks and their results. + +Reference +--------- + +.. py:class:: Cluster + + .. py:method:: start + + Spawns a cluster and then returns + + .. py:method:: stop + + Initiates :ref:`stop_procedure` and waits for it to finish. + + .. py:method:: stat + + returns a :class:`Stat` object with the current cluster status. + + .. py:attribute:: pid + + The cluster process id. + + .. py:attribute:: host + + The current hostname + + .. py:attribute:: sentinel + + returns the :class:`multiprocessing.Process` containing the :class:`Sentinel`. + + .. py:attribute:: timeout + + The clusters timeout setting in seconds + + .. py:attribute:: start_event + + A :class:`multiprocessing.Event` indicating if the :class:`Sentinel` has finished starting the cluster + + .. py:attribute:: stop_event + + A :class:`multiprocessing.Event` used to instruct the :class:`Sentinel` to initiate the :ref:`stop_procedure` + + .. py:attribute:: is_starting + + Bool indicating if the cluster is busy starting up + + .. py:attribute:: is_running + + Bool. Tells you if the cluster is up and running. + + .. py:attribute:: is_stopping + + Bool. Shows that the stop procedure has been started. + + .. py:attribute:: has_stopped + + Bool. Tells you if the cluster finished the stop procedure + + + diff --git a/docs/conf.py b/docs/conf.py index 3b4c727..1a07031 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,8 +38,12 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'django_q.tests.settings' extensions = [ 'alabaster', 'sphinx.ext.todo', + 'sphinx.ext.intersphinx', # 'sphinx.ext.autodoc' ] + +intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)} + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']