From af2790222ee9220171999b4fb18d0762cdacb87b Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 5 Aug 2010 18:16:02 +0200 Subject: [PATCH] Split simple userguide in two: connections and simple --- docs/userguide/connections.rst | 41 ++++++++++++++++++++++++++++++++++ docs/userguide/index.rst | 1 + docs/userguide/simple.rst | 38 ------------------------------- 3 files changed, 42 insertions(+), 38 deletions(-) create mode 100644 docs/userguide/connections.rst diff --git a/docs/userguide/connections.rst b/docs/userguide/connections.rst new file mode 100644 index 000000000..37e516c3b --- /dev/null +++ b/docs/userguide/connections.rst @@ -0,0 +1,41 @@ +============================ + Connections and transports +============================ + +To send and receive messages you need a transport and a connection. +There are several transports to choose from (amqplib, pika, redis, in-memory), +and you can even create your own. The default transport is amqplib. + +Create a connection using the default transport:: + + >>> from kombu import BrokerConnection + >>> connection = BrokerConnection() + +The connection will not be established yet, as the connection is established +when needed. If you want to explicitly establish the connection +you have to call the :meth:`~kombu.connection.BrokerConnection.connect` +method:: + + >>> connection.connect() + +This connection will use the default connection settings, which is using +the localhost host, default port, username ``guest``, +password ``guest`` and virtual host "/". A connection without arguments +is the same as:: + + >>> BrokerConnection(hostname="localhost", + ... userid="guest", + ... password="guest", + ... virtual_host="/", + ... port=6379) + +The default port is transport specific, for AMQP this is 6379. + +Other fields may also have different meaning depending on the transport +used. For example, the Redis transport uses the ``virtual_host`` argument as +the redis database number. + +See the :class:`~kombu.connection.BrokerConnection` reference documentation +for more information and a full list of the arguments supported. + +Specifying a diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index 2b1d4dbb8..2b241bbc9 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -8,4 +8,5 @@ .. toctree:: :maxdepth: 2 + connections simple diff --git a/docs/userguide/simple.rst b/docs/userguide/simple.rst index ed467bbf7..8ff526279 100644 --- a/docs/userguide/simple.rst +++ b/docs/userguide/simple.rst @@ -34,44 +34,6 @@ This is equivalent to:: >>> channel.close() >>> queue.close() -Connections and transports -========================== - -To send and receive messages you need a transport and a connection. -There are several transports to choose from (amqplib, pika, redis, in-memory), -and you can even create your own. The default transport is amqplib. - -Create a connection using the default transport:: - - >>> from kombu import BrokerConnection - >>> connection = BrokerConnection() - -The connection will not be established yet, as the connection is established -when needed. If you want to explicitly establish the connection -you have to call the :meth:`~kombu.connection.BrokerConnection.connect` -method:: - - >>> connection.connect() - -This connection will use the default connection settings, which is using -the localhost host, default port, username ``guest``, -password ``guest`` and virtual host "/". A connection without arguments -is the same as:: - - >>> BrokerConnection(hostname="localhost", - ... userid="guest", - ... password="guest", - ... virtual_host="/", - ... port=6379) - -The default port is transport specific, for AMQP this is 6379. - -Other fields may also have different meaning depending on the transport -used. For example, the Redis transport uses the ``virtual_host`` argument as -the redis database number. - -See the :class:`~kombu.connection.BrokerConnection` reference documentation -for more information and a full list of the arguments supported. Sending and receiving messages ==============================