aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2015-11-17 18:28:27 -0700
committerjason2015-11-17 18:28:27 -0700
commit5b382d406227329f5a875f408fc1c7d429b23d59 (patch)
tree384935703efb708d96367a6e333c38be15447353
parent9da146b8b847f9a8f722d9e62cd051985f7e614d (diff)
downloadeventmq-5b382d406227329f5a875f408fc1c7d429b23d59.tar.gz
eventmq-5b382d406227329f5a875f408fc1c7d429b23d59.zip
add protocol to documentation. add sender to documentation
-rw-r--r--docs/protocol.rst99
-rw-r--r--docs/sender.rst3
2 files changed, 102 insertions, 0 deletions
diff --git a/docs/protocol.rst b/docs/protocol.rst
new file mode 100644
index 0000000..48dcacc
--- /dev/null
+++ b/docs/protocol.rst
@@ -0,0 +1,99 @@
1EventMQ Protocol Specification
2==============================
3*The status of this document is alpha and subject to heavy change*
4
5Goals
6=====
7The EventMQ Protocol (eMQP) defines a reliable service-oriented request-reply and pub-sub dialog between a set of clients, a broker, and a set of workers. This goal is to
8
9The goals are to:
10
11 * Specify a protocol to follow when implementing a component to EventMQ.
12 * Allow requests to be routed to workers by an abstracted service name.
13 * Detect disconnected peers through heartbeating.
14 * Allow for message tracing and debugging.
15
16
17License
18=======
19This Specification is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
20
21This Specification is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
22
23Language
24========
25The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119[[1](http://tools.ietf.org/html/rfc2119)].
26
27Architecture
28============
29insert pretty picture here
30
31Topology
32--------
33eMQP connects a set of client applications (e.g. web servers), a broker, and a pool of workers. Clients connect to the broker as well as the workers.
34
35'Clients' is defined as application issuing requests and 'workers' as applications that process these requests. (Workers consist of a `JobManager` and a pool of `Worker` resources where the job executes.)
36
37The EventMQ broker handles a set of named queues. The broker SHOULD serve clients on a fair request and MAY deliver requests to workers on any basis, including 0MQ's built-in round robin or least-recently used.
38
39ROUTER Addressing
40-----------------
41In the case of request-reply, the broker MUST use a ROUTER socket to accept requests from both clients and workers. The broker MAY use a seperate socket implementing a subset of eMQP, or MAY use a single socket implementing all of eMQP.
42
43From the 0MQ manual[[2](http://api.zeromq.org/master:zmq-socket)]
44> When receiving messages a ROUTER socket shall prepend a message part containing the identity of the originating peer to the message before passing it to the application. When sending messages a ROUTER socket shall remove the first part of the message and use it to determine the identity of the peer the message shall be routed to.
45
46This extra frame is not shown in the specifications below.
47
48eMQP / Client
49-------------
50A **REQUEST** command consists of 7-frame multipart message, formatted as follows.
51
52====== ============== ===========
53FRAME Value Description
54====== ============== ===========
550 _EMPTY_ leave empty
561 eMQP/1.0 Protocol version
572 READY Command
583 _MSGID_ A unique id for the msg
594 _QUEUE_NAME_ the name of the queue the worker belongs to
605 _HEADERS_ dictionary of headers. can be an empty set
616 _MSG_ The message to send
62====== ============== ===========
63
64eMQP / Worker
65-------------
66An **INFORM** command consists of a 5-frame multipart message, formatted as follows.
67
68====== ============== ===========
69FRAME Value Description
70====== ============== ===========
710 _EMPTY_ leave empty
721 eMQP/1.0 Protocol version
732 INFORM
743 _MSGID_ A unique id for the msg
754 _QUEUE_NAME_ the name of the queue the worker belongs to
76====== ============== ===========
77
78A **READY** frame consists of a 4-frame multipart message, formatted as follows.
79
80====== ============== ===========
81FRAME Value Description
82====== ============== ===========
830 _EMPTY_ leave empty
841 eMQP/1.0 Protocol version
852 READY
863 _MSGID_ A unique id for the msg
87====== ============== ===========
88
89A **REPLY** frame consists of a 5-frame multipart message, formatted as follows.
90
91====== ============== ===========
92FRAME Value Description
93====== ============== ===========
940 _EMPTY_ leave empty
951 eMQP/1.0 Protocol version
962 REPLY
973 _MSGID_ A unique id for the msg
984 _MSG_ The reply to respond with
99====== ============== ===========
diff --git a/docs/sender.rst b/docs/sender.rst
new file mode 100644
index 0000000..67a1338
--- /dev/null
+++ b/docs/sender.rst
@@ -0,0 +1,3 @@
1.. automodule:: eventmq.sender
2 :members:
3 :special-members: