diff options
| author | barryp@macbook.home <barryp@macbook.home> | 2008-12-01 15:14:43 -0600 |
|---|---|---|
| committer | barryp@macbook.home <barryp@macbook.home> | 2008-12-01 15:14:43 -0600 |
| commit | 1e6786a8b7288b4d49c441739d4a22bcc099f13d (patch) | |
| tree | 0a1930536fa553a6f2cc776e07737cfdc187dbda /docs | |
| parent | 16507ca8e11a64dd36a01678b8bd7e06ba7b6cfe (diff) | |
| download | py-amqp-1e6786a8b7288b4d49c441739d4a22bcc099f13d.tar.gz | |
Add a document describing how the Python code is arranged, for people interested
in hacking on it. Mention the use_threading option in the Connection constructor.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/code_layout.txt | 44 | ||||
| -rw-r--r-- | docs/overview.txt | 5 |
2 files changed, 49 insertions, 0 deletions
diff --git a/docs/code_layout.txt b/docs/code_layout.txt new file mode 100644 index 0000000..2b71cf8 --- /dev/null +++ b/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 | + +-----------------------------+ diff --git a/docs/overview.txt b/docs/overview.txt index d482b99..9c58d59 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -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() |
