summaryrefslogtreecommitdiff
path: root/reference/kombu.transport.virtual.exchange.html
blob: 65103c6af6f395173238b61f5bf21eac71c9a1ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>kombu.transport.virtual.exchange &mdash; Kombu 2.1.3 documentation</title>
    
    <link rel="stylesheet" href="../_static/celery.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.1.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Kombu 2.1.3 documentation" href="../index.html" />
    <link rel="up" title="API Reference" href="index.html" />
    <link rel="next" title="kombu.transport.virtual.scheduling" href="kombu.transport.virtual.scheduling.html" />
    <link rel="prev" title="kombu.transport.virtual" href="kombu.transport.virtual.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kombu.transport.virtual.scheduling.html" title="kombu.transport.virtual.scheduling"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="kombu.transport.virtual.html" title="kombu.transport.virtual"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Kombu 2.1.3 documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">API Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-kombu.transport.virtual.exchange"></span><div class="section" id="kombu-transport-virtual-exchange">
<h1>kombu.transport.virtual.exchange<a class="headerlink" href="#kombu-transport-virtual-exchange" title="Permalink to this headline">¶</a></h1>
<p>Implementations of the standard exchanges defined
by the AMQ protocol  (excluding the <cite>headers</cite> exchange).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">copyright:</th><td class="field-body"><ol class="first loweralpha simple" start="3">
<li>2009 - 2012 by Ask Solem.</li>
</ol>
</td>
</tr>
<tr class="field-even field"><th class="field-name">license:</th><td class="field-body"><p class="first last">BSD, see LICENSE for more details.</p>
</td>
</tr>
</tbody>
</table>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#direct" id="id1">Direct</a></li>
<li><a class="reference internal" href="#topic" id="id2">Topic</a></li>
<li><a class="reference internal" href="#fanout" id="id3">Fanout</a></li>
<li><a class="reference internal" href="#interface" id="id4">Interface</a></li>
</ul>
</div>
<div class="section" id="direct">
<h2><a class="toc-backref" href="#id1">Direct</a><a class="headerlink" href="#direct" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="kombu.transport.virtual.exchange.DirectExchange">
<em class="property">class </em><tt class="descclassname">kombu.transport.virtual.exchange.</tt><tt class="descname">DirectExchange</tt><big>(</big><em>channel</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.DirectExchange" title="Permalink to this definition">¶</a></dt>
<dd><p>The <cite>direct</cite> exchange routes based on exact routing keys.</p>
<dl class="method">
<dt id="kombu.transport.virtual.exchange.DirectExchange.deliver">
<tt class="descname">deliver</tt><big>(</big><em>message</em>, <em>exchange</em>, <em>routing_key</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.DirectExchange.deliver" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.DirectExchange.lookup">
<tt class="descname">lookup</tt><big>(</big><em>table</em>, <em>exchange</em>, <em>routing_key</em>, <em>default</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.DirectExchange.lookup" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="kombu.transport.virtual.exchange.DirectExchange.type">
<tt class="descname">type</tt><em class="property"> = 'direct'</em><a class="headerlink" href="#kombu.transport.virtual.exchange.DirectExchange.type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="topic">
<h2><a class="toc-backref" href="#id2">Topic</a><a class="headerlink" href="#topic" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="kombu.transport.virtual.exchange.TopicExchange">
<em class="property">class </em><tt class="descclassname">kombu.transport.virtual.exchange.</tt><tt class="descname">TopicExchange</tt><big>(</big><em>channel</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange" title="Permalink to this definition">¶</a></dt>
<dd><p>The <cite>topic</cite> exchange routes messages based on words separated by
dots, using wildcard characters <tt class="docutils literal"><span class="pre">*</span></tt> (any single word), and <tt class="docutils literal"><span class="pre">#</span></tt>
(one or more words).</p>
<dl class="method">
<dt id="kombu.transport.virtual.exchange.TopicExchange.deliver">
<tt class="descname">deliver</tt><big>(</big><em>message</em>, <em>exchange</em>, <em>routing_key</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.deliver" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.TopicExchange.key_to_pattern">
<tt class="descname">key_to_pattern</tt><big>(</big><em>rkey</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.key_to_pattern" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the corresponding regex for any routing key.</p>
</dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.TopicExchange.lookup">
<tt class="descname">lookup</tt><big>(</big><em>table</em>, <em>exchange</em>, <em>routing_key</em>, <em>default</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.lookup" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.TopicExchange.prepare_bind">
<tt class="descname">prepare_bind</tt><big>(</big><em>queue</em>, <em>exchange</em>, <em>routing_key</em>, <em>arguments</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.prepare_bind" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="kombu.transport.virtual.exchange.TopicExchange.type">
<tt class="descname">type</tt><em class="property"> = 'topic'</em><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="kombu.transport.virtual.exchange.TopicExchange.wildcards">
<tt class="descname">wildcards</tt><em class="property"> = {'#': '.*?', '*': '.*?[^\\.]'}</em><a class="headerlink" href="#kombu.transport.virtual.exchange.TopicExchange.wildcards" title="Permalink to this definition">¶</a></dt>
<dd><p>map of wildcard to regex conversions</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="fanout">
<h2><a class="toc-backref" href="#id3">Fanout</a><a class="headerlink" href="#fanout" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="kombu.transport.virtual.exchange.FanoutExchange">
<em class="property">class </em><tt class="descclassname">kombu.transport.virtual.exchange.</tt><tt class="descname">FanoutExchange</tt><big>(</big><em>channel</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.FanoutExchange" title="Permalink to this definition">¶</a></dt>
<dd><p>The <cite>fanout</cite> exchange implements broadcast messaging by delivering
copies of all messages to all queues bound the the exchange.</p>
<p>To support fanout the virtual channel needs to store the table
as shared state.  This requires that the <cite>Channel.supports_fanout</cite>
attribute is set to true, and the <cite>Channel._queue_bind</cite> and
<cite>Channel.get_table</cite> methods are implemented.  See the redis backend
for an example implementation of these methods.</p>
<dl class="method">
<dt id="kombu.transport.virtual.exchange.FanoutExchange.deliver">
<tt class="descname">deliver</tt><big>(</big><em>message</em>, <em>exchange</em>, <em>routing_key</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.FanoutExchange.deliver" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.FanoutExchange.lookup">
<tt class="descname">lookup</tt><big>(</big><em>table</em>, <em>exchange</em>, <em>routing_key</em>, <em>default</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.FanoutExchange.lookup" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="kombu.transport.virtual.exchange.FanoutExchange.type">
<tt class="descname">type</tt><em class="property"> = 'fanout'</em><a class="headerlink" href="#kombu.transport.virtual.exchange.FanoutExchange.type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="interface">
<h2><a class="toc-backref" href="#id4">Interface</a><a class="headerlink" href="#interface" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="kombu.transport.virtual.exchange.ExchangeType">
<em class="property">class </em><tt class="descclassname">kombu.transport.virtual.exchange.</tt><tt class="descname">ExchangeType</tt><big>(</big><em>channel</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.ExchangeType" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements the specifics for an exchange type.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> &#8211; AMQ Channel</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="kombu.transport.virtual.exchange.ExchangeType.equivalent">
<tt class="descname">equivalent</tt><big>(</big><em>prev</em>, <em>exchange</em>, <em>type</em>, <em>durable</em>, <em>auto_delete</em>, <em>arguments</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.ExchangeType.equivalent" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if <cite>prev</cite> and <cite>exchange</cite> is equivalent.</p>
</dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.ExchangeType.lookup">
<tt class="descname">lookup</tt><big>(</big><em>table</em>, <em>exchange</em>, <em>routing_key</em>, <em>default</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.ExchangeType.lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Lookup all queues matching <cite>routing_key</cite> in <cite>exchange</cite>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><cite>default</cite> if no queues matched.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="kombu.transport.virtual.exchange.ExchangeType.prepare_bind">
<tt class="descname">prepare_bind</tt><big>(</big><em>queue</em>, <em>exchange</em>, <em>routing_key</em>, <em>arguments</em><big>)</big><a class="headerlink" href="#kombu.transport.virtual.exchange.ExchangeType.prepare_bind" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns tuple of <cite>(routing_key, regex, queue)</cite> to be stored
for bindings to this exchange.</p>
</dd></dl>

<dl class="attribute">
<dt id="kombu.transport.virtual.exchange.ExchangeType.type">
<tt class="descname">type</tt><em class="property"> = None</em><a class="headerlink" href="#kombu.transport.virtual.exchange.ExchangeType.type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><p class="logo"><a href="../index.html">
  <img class="logo" width="128" height="128" src="http://cloud.github.com/downloads/ask/kombu/kombusmall.jpg" alt="Logo"/>
</a></p>
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">kombu.transport.virtual.exchange</a><ul>
<li><a class="reference internal" href="#direct">Direct</a></li>
<li><a class="reference internal" href="#topic">Topic</a></li>
<li><a class="reference internal" href="#fanout">Fanout</a></li>
<li><a class="reference internal" href="#interface">Interface</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="kombu.transport.virtual.html"
                        title="previous chapter">kombu.transport.virtual</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="kombu.transport.virtual.scheduling.html"
                        title="next chapter">kombu.transport.virtual.scheduling</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/reference/kombu.transport.virtual.exchange.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kombu.transport.virtual.scheduling.html" title="kombu.transport.virtual.scheduling"
             >next</a> |</li>
        <li class="right" >
          <a href="kombu.transport.virtual.html" title="kombu.transport.virtual"
             >previous</a> |</li>
        <li><a href="../index.html">Kombu 2.1.3 documentation</a> &raquo;</li>
          <li><a href="index.html" >API Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2012, Ask Solem.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
    </div>
  </body>
</html>