Commit 2f7bc2ac authored by xa's avatar xa

Merge branch 'docs' into 'master'

Docs



See merge request !9
parents eee68a8b f0845c80
Pipeline #539 passed with stages
......@@ -52,25 +52,6 @@ class PyGeneratorMethod(PyGeneratorMixin, PyClassmember):
return PyClassmember.run(self)
class PyCoroutineMixin(object):
def handle_signature(self, sig, signode):
ret = super().handle_signature(sig, signode)
signode.insert(0, addnodes.desc_annotation('coroutine ', 'coroutine '))
return ret
class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel):
def run(self):
self.name = 'py:function'
return PyModulelevel.run(self)
class PyCoroutineMethod(PyCoroutineMixin, PyClassmember):
def run(self):
self.name = 'py:method'
return PyClassmember.run(self)
class PyTaskMixin(object):
def handle_signature(self, sig, signode):
ret = super().handle_signature(sig, signode)
......@@ -106,11 +87,11 @@ class FunctionDocumenter(FunctionDocumenter):
if getattr(obj, '_is_task', False):
self.directivetype = 'task'
self.member_order = self.member_order + 2
elif inspect.isawaitable(obj):
elif inspect.iscoroutinefunction(obj):
self.directivetype = 'async'
self.member_order = self.member_order + 2
elif getattr(obj, '_is_coroutine', False):
self.directivetype = 'coroutine'
self.directivetype = 'async'
self.member_order = self.member_order - 2
elif inspect.isgeneratorfunction(obj):
self.directivetype = 'generator'
......@@ -134,11 +115,11 @@ class MethodDocumenter(MethodDocumenter):
if getattr(obj, '_is_task', False):
self.directivetype = 'taskmethod'
self.member_order = self.member_order - 2
elif inspect.isawaitable(obj):
elif inspect.iscoroutinefunction(obj):
self.directivetype = 'asyncmethod'
self.member_order = self.member_order + 2
elif getattr(obj, '_is_coroutine', False):
self.directivetype = 'coroutinemethod'
self.directivetype = 'asyncmethod'
self.member_order = self.member_order - 2
elif inspect.isgeneratorfunction(obj):
self.directivetype = 'generatormethod'
......@@ -153,9 +134,6 @@ def setup(app):
app.add_directive_to_domain('py', 'generator', PyGeneratorFunction)
app.add_directive_to_domain('py', 'generatormethod', PyGeneratorMethod)
app.add_directive_to_domain('py', 'coroutine', PyCoroutineFunction)
app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod)
app.add_directive_to_domain('py', 'task', PyTaskFunction)
app.add_directive_to_domain('py', 'taskmethod', PyTaskMethod)
......
......@@ -30,7 +30,7 @@ needs_sphinx = '1.3'
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
# 'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'pyspecific'
]
......
.. py:module:: aiodisque
.. _getting-started:
Getting started
===============
AIODisque Getting started
=========================
Install from Pypi:
......
......@@ -6,16 +6,47 @@
AIO Disque
==========
AIO Disque is an asyncio client for Disque_, an ongoing experiment to build a
distributed, in-memory, message broker.
AIO Disque is a modern client for Disque_ — an ongoing experiment to build a
distributed, in-memory, message broker — using Python coroutines and the
explicit async/await introduced in Python3.5.
It works exclusively with >= Python3.5.
Contents
--------
.. toctree::
:maxdepth: 2
:maxdepth: 1
getting-started
api
reference
Installation
------------
AIO Disques requires Python 3.5. You can install it using ``pip``::
% python -m pip install aiodisque
An example
----------
Here is how to send and receive jobs from a local Disque server:
.. code-block:: python
from aiodisque import Disque
client = Disque()
job_id = await client.sendjob('my-queue', 'body')
job = await client.getjob('my-queue')
Additional Features
-------------------
AIO Disque tends to be 100% compatible with the disque api document.
It provides additional python goodies for queues and results iteration.
Indices and tables
......@@ -24,4 +55,6 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`
Documentation generated for version |version| and |release|.
.. _Disque: https://github.com/antirez/disque
.. py:module:: aiodisque
.. _api:
API
===
AIODisque Reference Manual
==========================
This manual lists the basic functionality provided by aiodisque.
.. autoclass:: Disque
:members:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment