Skip to content

Commit

Permalink
Add a document describing how the Python code is arranged, for people…
Browse files Browse the repository at this point in the history
… interested

in hacking on it.  Mention the use_threading option in the Connection constructor.
  • Loading branch information
barryp@macbook.home committed Dec 1, 2008
1 parent 7fff8c9 commit 6f778d6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/code_layout.txt
@@ -0,0 +1,44 @@
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.

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.

This is the general arrangement of how the classes communicate with
each other:

+-----------+ +-----------+
channel.py | Channel | ... | Channel |
+-----------+ +-----------+
^ ^
| |
V V
+--------------------------------------+
connection.py | Connection |
+-------+------------------------------+
| ^
| |
V |
+----------------+ +--------+-------+
method_framing.py | MethodWriter | | MethodReader |
+-------+--------+ +----------------+
| ^
| |
V |
+----------------+ +--------+-------+
serialization.py | AMQPWriter | | AMQPReader |
+-------+--------+ +----------------+
| ^
| |
V |
+--------------------------+--+
|TCP Socket, perhaps with SSL |
+-----------------------------+
5 changes: 5 additions & 0 deletions docs/overview.txt
Expand Up @@ -25,6 +25,11 @@ Some examples for creating a Connection object:
conn = amqp.Connection(host='1.2.3.4:5672', ssl=True)
conn = amqp.Connection(userid='foo', password='bar')

Non-blocking waits, timeouts, and flow-control require that an
optional threading mode be enabled with: use_threading=True, as in:

conn = amqp.Connection('1.2.3.4', use_threading=True)

Connections are closed with the close() method

conn.close()
Expand Down

0 comments on commit 6f778d6

Please sign in to comment.