From 441ecc70782e7295840fdab9ad2918874f89abed Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sat, 28 Jan 2017 16:50:48 +0100 Subject: [PATCH] started with docs --- README.md | 3 +++ docs/conf.py | 8 ++++++-- docs/index.rst | 1 + docs/tutorial.md | 28 ++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 docs/tutorial.md diff --git a/README.md b/README.md index 9a50092..3feb447 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ CoolAMQP ======== +[](http://coolamqp.readthedocs.io/en/latest/?badge=latest) [](https://badge.fury.io/py/CoolAMQP) [](https://travis-ci.org/smok-serwis/coolamqp) [](https://codeclimate.com/github/smok-serwis/coolamqp) @@ -10,6 +11,8 @@ CoolAMQP A **magical** AMQP client, that uses **heavy sorcery** to achieve speeds that other AMQP clients cannot even hope to match. +Documentation (WIP) is available at [Read the Docs](http://coolamqp.readthedocs.io/). + tl;dr - [this](coolamqp/framing/definitions.py) is **machine-generated** compile-time. [this](coolamqp/framing/compilation/content_property.py) **generates classes run-time**, and there are memoryviews **_everywhere_**. diff --git a/docs/conf.py b/docs/conf.py index 7113ed9..04b6e42 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,11 @@ # import os # import sys # sys.path.insert(0, os.path.abspath('.')) +from recommonmark.parser import CommonMarkParser +source_parsers = { + '.md': CommonMarkParser +} # -- General configuration ------------------------------------------------ @@ -53,9 +57,9 @@ author = u'DMS Serwis s.c.' # built documents. # # The short X.Y version. -version = u'0.9 series' +version = '0.89' # The full version, including alpha/beta/rc tags. -release = u'0.9 series' +release = u'0.89-latest' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 015970e..a499442 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ Welcome to CoolAMQP's documentation! :maxdepth: 2 :caption: Contents: + tutorial Indices and tables diff --git a/docs/tutorial.md b/docs/tutorial.md new file mode 100644 index 0000000..7e3152a --- /dev/null +++ b/docs/tutorial.md @@ -0,0 +1,28 @@ +# Tutorial + +If you want to connect to an AMQP broker, you need: +* it's address (and port) +* login and password +* name of the virtual host + +An idea of a heartbeat interval would be good, but you can do without. Since CoolAMQP will support clusters +in the future, you should define the nodes first. You can do it using _NodeDefinition_. +See NodeDefinition's documentation for alternative ways to do this, but here we will use +the AMQP connection string. + +```python +from coolamqp.objects import NodeDefinition + +node = NodeDefinition('amqp://user@password:host/vhost') +``` + +_Cluster_ instances are used to interface with the cluster (or a single broker). It +accepts a list of nodes: + +```python +from coolamqp.clustering import Cluster +cluster = Cluster([node]) +cluster.start(wait=True) +``` + +_wait=True_ will block until connection is completed. After this, you can use other methods. \ No newline at end of file -- GitLab