summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorbarryp@macbook.home <barryp@macbook.home>2009-01-15 20:14:02 -0600
committerbarryp@macbook.home <barryp@macbook.home>2009-01-15 20:14:02 -0600
commit3924e8241dcaee7a596d55501879a7b7e9e62674 (patch)
tree6d8c1e209ef5bf5a0c82ed63ffe0a460d32a05a2 /docs
parentc7b341621f91e43da2ec2095654ec24296d5356f (diff)
downloadpy-amqp-3924e8241dcaee7a596d55501879a7b7e9e62674.tar.gz
Polish up the docs a bit, including a warning to be sure to
close Connection or Channel objects otherwise you could lose messages when the program ends.
Diffstat (limited to 'docs')
-rw-r--r--docs/code_layout.txt31
-rw-r--r--docs/overview.txt13
2 files changed, 32 insertions, 12 deletions
diff --git a/docs/code_layout.txt b/docs/code_layout.txt
index a266a1d..aeff7af 100644
--- a/docs/code_layout.txt
+++ b/docs/code_layout.txt
@@ -2,15 +2,10 @@ General layout of the Python code for those interested in hacking on it.
------------------------------------------------------------------------
The Connection class in connection.py is the heart of the library, it
-opens the TCP connection, optionally wraps it in SSL, wires together
-the various other classes.
+wires together the various other classes.
-MethodReader and MethodWriter in method_framing.py should not be visible
-to the amqplib user. MethodReader is where the option for threading is
-implemented.
-
-AMQPReader and AMQPWriter are reused it many other places within the
-Channel and Connection classes, not just in the layer shown below.
+The items in method_framing.py and transport.py should not be visible
+to the amqplib user.
This is the general arrangement of how the classes communicate with
each other:
@@ -31,14 +26,30 @@ connection.py | Connection |
method_framing.py | MethodWriter | | MethodReader |
+-------+--------+ +----------------+
| ^
- | frames |
+ | frames |
V |
+------------------------------+-------+
transport.py | TCPTransport or SSLTransport |
+-------+------------------------------+
| ^
- | bytes |
+ | bytes |
V |
+--------------------------+--+
| TCP Socket |
+-----------------------------+
+
+
+Other notable bits of code are:
+
+ abstract_channel.py - Contains a common superclass for Connection
+ and Channel classes.
+
+ basic_message.py - Location of the Message class - which is what
+ is mostly being sent/received over the Channels.
+
+ exceptions.py - For indicating when things go wrong.
+
+ serialization.py - Home of AMQPReader and AMQPWriter which are
+ used are used in many places within the
+ Channel and Connection classes.
+
diff --git a/docs/overview.txt b/docs/overview.txt
index 9c58d59..076d147 100644
--- a/docs/overview.txt
+++ b/docs/overview.txt
@@ -53,6 +53,15 @@ Channels have a close() method too, which doesn't affect other channels
ch2.close()
++----------------------------------------------------------------
+|
+| IMPORTANT!! - be sure to close your channels or connection
+| if you've been calling async methods like
+| basic_publish() - to ensure your messages are
+| actually flushed out the TCP socket before the
+| program ends, instead of potentially being lost.
+|
++----------------------------------------------------------------
Access Tickets
--------------
@@ -151,8 +160,8 @@ messages to the channel as they're placed into the queue.
while True:
ch.wait()
-The above example will loop forever. To cancel the 'consume', use
-basic_cancel() with a consumer_tag. A consumer_tag is a string that's
+The above example will loop forever. To cancel the 'consume', use
+basic_cancel() with a consumer_tag. A consumer_tag is a string that's
either specified when you call basic_consume()
ch.basic_consume('myqueue', callback=mycallback, consumer_tag='mytag')