blob: 6a9a0965b12ef914b86be7d69ac65baee99656a8 [file] [log] [blame]
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>proton.Messenger</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="proton-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://qpid.apache.org/index.html">Qpid Proton Python API</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="proton-module.html">Package&nbsp;proton</a> ::
Class&nbsp;Messenger
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="proton.Messenger-class.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Messenger</h1><p class="nomargin-top"><span class="codelink"><a href="proton-pysrc.html#Messenger">source&nbsp;code</a></span></p>
<center>
</center>
<hr />
<p>The <a href="proton.Messenger-class.html" class="link">Messenger</a>
class defines a high level interface for sending and receiving <a
href="proton.Message-class.html" class="link">Messages</a>. Every <a
href="proton.Messenger-class.html" class="link">Messenger</a> contains a
single logical queue of incoming messages and a single logical queue of
outgoing messages. These messages in these queues may be destined for, or
originate from, a variety of addresses.</p>
<p>The messenger interface is single-threaded. All methods except one
(<a href="proton.Messenger-class.html#interrupt"
class="link">interrupt</a>) are intended to be used from within the
messenger thread.</p>
<h1 class="heading">Address Syntax</h1>
<p>An address has the following form:</p>
<pre class="literalblock">
[ amqp[s]:// ] [user[:password]@] domain [/[name]]
</pre>
<p>Where domain can be one of:</p>
<pre class="literalblock">
host | host:port | ip | ip:port | name
</pre>
<p>The following are valid examples of addresses:</p>
<ul>
<li>
example.org
</li>
<li>
example.org:1234
</li>
<li>
amqp://example.org
</li>
<li>
amqps://example.org
</li>
<li>
example.org/incoming
</li>
<li>
amqps://example.org/outgoing
</li>
<li>
amqps://fred:trustno1@example.org
</li>
<li>
127.0.0.1:1234
</li>
<li>
amqps://127.0.0.1:1234
</li>
</ul>
<h1 class="heading">Sending &amp; Receiving Messages</h1>
<p>The <a href="proton.Messenger-class.html" class="link">Messenger</a>
class works in conjunction with the <a href="proton.Message-class.html"
class="link">Message</a> class. The <a href="proton.Message-class.html"
class="link">Message</a> class is a mutable holder of message
content.</p>
<p>The <a href="proton.Messenger-class.html#put" class="link">put</a>
method copies its <a href="proton.Message-class.html"
class="link">Message</a> to the outgoing queue, and may send queued
messages if it can do so without blocking. The <a
href="proton.Messenger-class.html#send" class="link">send</a> method
blocks until it has sent the requested number of messages, or until a
timeout interrupts the attempt.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>message = Message()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">for</span> i <span class="py-keyword">in</span> range(3):
<span class="py-more">... </span> message.address = <span class="py-string">&quot;amqp://host/queue&quot;</span>
<span class="py-more">... </span> message.subject = <span class="py-string">&quot;Hello World %i&quot;</span> % i
<span class="py-more">... </span> messenger.put(message)
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.send()</pre>
<p>Similarly, the <a href="proton.Messenger-class.html#recv"
class="link">recv</a> method receives messages into the incoming queue,
and may block as it attempts to receive the requested number of
messages, or until timeout is reached. It may receive fewer than the
requested number. The <a href="proton.Messenger-class.html#get"
class="link">get</a> method pops the eldest <a
href="proton.Message-class.html" class="link">Message</a> off the
incoming queue and copies it into the <a
href="proton.Message-class.html" class="link">Message</a> object that
you supply. It will not block.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>message = Message()
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.recv(10):
<span class="py-prompt">&gt;&gt;&gt; </span>while messenger.incoming &gt; 0:
<span class="py-more">... </span> messenger.get(message)
<span class="py-more">... </span> <span class="py-keyword">print</span> message.subject
<span class="py-output">Hello World 0</span>
<span class="py-output">Hello World 1</span>
<span class="py-output">Hello World 2</span></pre>
<p>The blocking flag allows you to turn off blocking behavior entirely,
in which case <a href="proton.Messenger-class.html#send"
class="link">send</a> and <a href="proton.Messenger-class.html#recv"
class="link">recv</a> will do whatever they can without blocking, and
then return. You can then look at the number of incoming and outgoing
messages to see how much outstanding work still remains.</p>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Instance Methods</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">name</span>=<span class="summary-sig-default">None</span>)</span><br />
Construct a new <a href="proton.Messenger-class.html"
class="link">Messenger</a> with the given name.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.__init__">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#__del__" class="summary-sig-name">__del__</a>(<span class="summary-sig-arg">self</span>)</span><br />
Destroy the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.__del__">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#name" class="summary-sig-name">name</a>(<span class="summary-sig-arg">self</span>)</span><br />
The name of the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.name">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#start" class="summary-sig-name">start</a>(<span class="summary-sig-arg">self</span>)</span><br />
Currently a no-op placeholder.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.start">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#stop" class="summary-sig-name">stop</a>(<span class="summary-sig-arg">self</span>)</span><br />
Transitions the <a href="proton.Messenger-class.html"
class="link">Messenger</a> to an inactive state.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.stop">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#stopped" class="summary-sig-name">stopped</a>(<span class="summary-sig-arg">self</span>)</span><br />
Returns true iff a <a href="proton.Messenger-class.html"
class="link">Messenger</a> is in the stopped state.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.stopped">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#subscribe" class="summary-sig-name">subscribe</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">source</span>)</span><br />
Subscribes the <a href="proton.Messenger-class.html"
class="link">Messenger</a> to messages originating from the specified
source.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.subscribe">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#put" class="summary-sig-name">put</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">message</span>)</span><br />
Places the content contained in the message onto the outgoing queue
of the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.put">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#status" class="summary-sig-name">status</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">tracker</span>)</span><br />
Gets the last known remote state of the delivery associated with the
given tracker.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.status">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#buffered" class="summary-sig-name">buffered</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">tracker</span>)</span><br />
Checks if the delivery associated with the given tracker is still
waiting to be sent.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.buffered">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#settle" class="summary-sig-name">settle</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">tracker</span>=<span class="summary-sig-default">None</span>)</span><br />
Frees a <a href="proton.Messenger-class.html"
class="link">Messenger</a> from tracking the status associated with a
given tracker.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.settle">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#send" class="summary-sig-name">send</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">n</span>=<span class="summary-sig-default">-1</span>)</span><br />
This call will block until the indicated number of <a
href="proton.Message-class.html" class="link">messages</a> have been
sent, or until the operation times out.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.send">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#recv" class="summary-sig-name">recv</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">n</span>=<span class="summary-sig-default">None</span>)</span><br />
Receives up to <i>n</i> <a href="proton.Message-class.html"
class="link">messages</a> into the incoming queue.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.recv">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#work" class="summary-sig-name">work</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">timeout</span>=<span class="summary-sig-default">None</span>)</span><br />
Sends or receives any outstanding <a href="proton.Message-class.html"
class="link">messages</a> queued for a <a
href="proton.Messenger-class.html" class="link">Messenger</a>.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.work">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#receiving" class="summary-sig-name">receiving</a>(<span class="summary-sig-arg">self</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.receiving">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#interrupt" class="summary-sig-name">interrupt</a>(<span class="summary-sig-arg">self</span>)</span><br />
The <a href="proton.Messenger-class.html" class="link">Messenger</a>
interface is single-threaded.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.interrupt">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#get" class="summary-sig-name">get</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">message</span>=<span class="summary-sig-default">None</span>)</span><br />
Moves the message from the head of the incoming message queue into
the supplied message object.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.get">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#accept" class="summary-sig-name">accept</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">tracker</span>=<span class="summary-sig-default">None</span>)</span><br />
Signal the sender that you have acted on the <a
href="proton.Message-class.html" class="link">Message</a> pointed to
by the tracker.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.accept">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#reject" class="summary-sig-name">reject</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">tracker</span>=<span class="summary-sig-default">None</span>)</span><br />
Rejects the <a href="proton.Message-class.html"
class="link">Message</a> indicated by the tracker.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.reject">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#outgoing" class="summary-sig-name">outgoing</a>(<span class="summary-sig-arg">self</span>)</span><br />
The outgoing queue depth.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.outgoing">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#incoming" class="summary-sig-name">incoming</a>(<span class="summary-sig-arg">self</span>)</span><br />
The incoming queue depth.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.incoming">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#route" class="summary-sig-name">route</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">pattern</span>,
<span class="summary-sig-arg">address</span>)</span><br />
Adds a routing rule to a <a href="proton.Messenger-class.html"
class="link">Messenger's</a> internal routing table.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.route">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#rewrite" class="summary-sig-name">rewrite</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">pattern</span>,
<span class="summary-sig-arg">address</span>)</span><br />
Similar to route(), except that the destination of the <a
href="proton.Message-class.html" class="link">Message</a> is
determined before the message address is rewritten.</td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.rewrite">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="selectable"></a><span class="summary-sig-name">selectable</span>(<span class="summary-sig-arg">self</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.selectable">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="proton.Messenger-class.html#deadline" class="summary-sig-name">deadline</a>(<span class="summary-sig-arg">self</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="proton-pysrc.html#Messenger.deadline">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Class Variables</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#certificate" class="summary-name">certificate</a> = <code title="property(_get_certificate, _set_certificate, doc= &quot;&quot;&quot;
Path to a certificate file for the L{Messenger}. This certificate is
used when the L{Messenger} accepts or establishes SSL/TLS connections.
This property must be specified for the L{Messenger} to accept
incoming SSL/TLS connections and to establish client authenticated
outgoing SSL/TLS connection. Non client authenticated outgoing SSL/TLS
connections do not require this property.
&quot;&quot;&quot;)">property(_get_certificate, _set_certificate, doc<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#private_key" class="summary-name">private_key</a> = <code title="property(_get_private_key, _set_private_key, doc= &quot;&quot;&quot;
Path to a private key file for the L{Messenger's&lt;Messenger&gt;}
certificate. This property must be specified for the L{Messenger} to
accept incoming SSL/TLS connections and to establish client
authenticated outgoing SSL/TLS connection. Non client authenticated
SSL/TLS connections do not require this property.
&quot;&quot;&quot;)">property(_get_private_key, _set_private_key, doc<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#password" class="summary-name">password</a> = <code title="property(_get_password, _set_password, doc= &quot;&quot;&quot;
This property contains the password for the L{Messenger.private_key}
file, or None if the file is not encrypted.
&quot;&quot;&quot;)">property(_get_password, _set_password, doc= <code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#trusted_certificates" class="summary-name">trusted_certificates</a> = <code title="property(_get_trusted_certificates, _set_trusted_certificates, doc= &quot;&quot;\
&quot;
A path to a database of trusted certificates for use in verifying the
peer on an SSL/TLS connection. If this property is None, then the peer
will not be verified.
&quot;&quot;&quot;)">property(_get_trusted_certificates, _se<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#timeout" class="summary-name">timeout</a> = <code title="property(_get_timeout, _set_timeout, doc= &quot;&quot;&quot;
The timeout property contains the default timeout for blocking
operations performed by the L{Messenger}.
&quot;&quot;&quot;)">property(_get_timeout, _set_timeout, doc= <code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#blocking" class="summary-name">blocking</a> = <code title="property(_is_blocking, _set_blocking, doc= &quot;&quot;&quot;
Enable or disable blocking behavior during L{Message} sending
and receiving. This affects every blocking call, with the
exception of L{work}. Currently, the affected calls are
L{send}, L{recv}, and L{stop}.
&quot;&quot;&quot;)">property(_is_blocking, _set_blocking, doc= <code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#passive" class="summary-name">passive</a> = <code title="property(_is_passive, _set_passive, doc= &quot;&quot;&quot;
When passive is set to true, Messenger will not attempt to perform I/O
internally. In this mode it is necessary to use the selectables API to
drive any I/O needed to perform requested actions. In this mode
Messenger will never block.
&quot;&quot;&quot;)">property(_is_passive, _set_passive, doc= <code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#incoming_window" class="summary-name">incoming_window</a> = <code title="property(_get_incoming_window, _set_incoming_window, doc= &quot;&quot;&quot;
The incoming tracking window for the messenger. The messenger will
track the remote status of this many incoming deliveries after they
have been accepted or rejected. Defaults to zero.
L{Messages&lt;Message&gt;} enter this window only when you take them into yo\
ur application
using L{get}. If your incoming window size is I{n}, and you get I{n}+\
...">property(_get_incoming_window, _set_incoming<code class="variable-ellipsis">...</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="proton.Messenger-class.html#outgoing_window" class="summary-name">outgoing_window</a> = <code title="property(_get_outgoing_window, _set_outgoing_window, doc= &quot;&quot;&quot;
The outgoing tracking window for the messenger. The messenger will
track the remote status of this many outgoing deliveries after calling
send. Defaults to zero.
A L{Message} enters this window when you call the put() method with th\
e
message. If your outgoing window size is I{n}, and you call L{put} I{\
...">property(_get_outgoing_window, _set_outgoing<code class="variable-ellipsis">...</code></code>
</td>
</tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">name</span>=<span class="sig-default">None</span>)</span>
<br /><em class="fname">(Constructor)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.__init__">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Construct a new <a href="proton.Messenger-class.html"
class="link">Messenger</a> with the given name. The name has global
scope. If a NULL name is supplied, a UUID based name will be chosen.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>name</code></strong> (string) - the name of the messenger or None</li>
</ul></dd>
<dt>Overrides:
object.__init__
</dt>
</dl>
</td></tr></table>
</div>
<a name="__del__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__del__</span>(<span class="sig-arg">self</span>)</span>
<br /><em class="fname">(Destructor)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.__del__">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Destroy the <a href="proton.Messenger-class.html"
class="link">Messenger</a>. This will close all connections that are
managed by the <a href="proton.Messenger-class.html"
class="link">Messenger</a>. Call the <a
href="proton.Messenger-class.html#stop" class="link">stop</a> method
before destroying the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="name"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">name</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.name">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>The name of the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</p>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="start"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">start</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.start">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Currently a no-op placeholder. For future compatibility, do not <a
href="proton.Messenger-class.html#send" class="link">send</a> or <a
href="proton.Messenger-class.html#recv" class="link">recv</a> messages
before starting the <a href="proton.Messenger-class.html"
class="link">Messenger</a>.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="stop"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">stop</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.stop">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Transitions the <a href="proton.Messenger-class.html"
class="link">Messenger</a> to an inactive state. An inactive <a
href="proton.Messenger-class.html" class="link">Messenger</a> will not
send or receive messages from its internal queues. A <a
href="proton.Messenger-class.html" class="link">Messenger</a> should be
stopped before being discarded to ensure a clean shutdown handshake
occurs on any internally managed connections.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="stopped"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">stopped</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.stopped">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Returns true iff a <a href="proton.Messenger-class.html"
class="link">Messenger</a> is in the stopped state. This function does
not block.</p>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="subscribe"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">subscribe</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">source</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.subscribe">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Subscribes the <a href="proton.Messenger-class.html"
class="link">Messenger</a> to messages originating from the specified
source. The source is an address as specified in the <a
href="proton.Messenger-class.html" class="link">Messenger</a>
introduction with the following addition. If the domain portion of the
address begins with the '~' character, the <a
href="proton.Messenger-class.html" class="link">Messenger</a> will
interpret the domain as host/port, bind to it, and listen for incoming
messages. For example &quot;~0.0.0.0&quot;, &quot;amqp://~0.0.0.0&quot;,
and &quot;amqps://~0.0.0.0&quot; will all bind to any local interface and
listen for incoming messages with the last variant only permitting
incoming SSL connections.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>source</code></strong> (string) - the source of messages to subscribe to</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="put"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">put</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">message</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.put">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Places the content contained in the message onto the outgoing queue of
the <a href="proton.Messenger-class.html" class="link">Messenger</a>.
This method will never block, however it will send any unblocked <a
href="proton.Message-class.html" class="link">Messages</a> in the
outgoing queue immediately and leave any blocked <a
href="proton.Message-class.html" class="link">Messages</a> remaining in
the outgoing queue. The <a href="proton.Messenger-class.html#send"
class="link">send</a> call may be used to block until the outgoing queue
is empty. The <a href="proton.Messenger-class.html#outgoing"
class="link">outgoing</a> property may be used to check the depth of the
outgoing queue.</p>
<p>When the content in a given <a href="proton.Message-class.html"
class="link">Message</a> object is copied to the outgoing message queue,
you may then modify or discard the <a href="proton.Message-class.html"
class="link">Message</a> object without having any impact on the content
in the outgoing queue.</p>
<p>This method returns an outgoing tracker for the <a
href="proton.Message-class.html" class="link">Message</a>. The tracker
can be used to determine the delivery status of the <a
href="proton.Message-class.html" class="link">Message</a>.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>message</code></strong> (Message) - the message to place in the outgoing queue</li>
</ul></dd>
<dt>Returns:</dt>
<dd>a tracker</dd>
</dl>
</td></tr></table>
</div>
<a name="status"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">status</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">tracker</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.status">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Gets the last known remote state of the delivery associated with the
given tracker.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>tracker</code></strong> (tracker) - the tracker whose status is to be retrieved</li>
</ul></dd>
<dt>Returns:</dt>
<dd>one of None, PENDING, REJECTED, MODIFIED, or ACCEPTED</dd>
</dl>
</td></tr></table>
</div>
<a name="buffered"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">buffered</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">tracker</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.buffered">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Checks if the delivery associated with the given tracker is still
waiting to be sent.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>tracker</code></strong> (tracker) - the tracker whose status is to be retrieved</li>
</ul></dd>
<dt>Returns:</dt>
<dd>true if delivery is still buffered</dd>
</dl>
</td></tr></table>
</div>
<a name="settle"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">settle</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">tracker</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.settle">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Frees a <a href="proton.Messenger-class.html"
class="link">Messenger</a> from tracking the status associated with a
given tracker. If you don't supply a tracker, all outgoing <a
href="proton.Message-class.html" class="link">messages</a> up to the most
recent will be settled.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="send"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">send</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">n</span>=<span class="sig-default">-1</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.send">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>This call will block until the indicated number of <a
href="proton.Message-class.html" class="link">messages</a> have been
sent, or until the operation times out. If n is -1 this call will block
until all outgoing <a href="proton.Message-class.html"
class="link">messages</a> have been sent. If n is 0 then this call will
send whatever it can without blocking.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="recv"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">recv</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">n</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.recv">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Receives up to <i>n</i> <a href="proton.Message-class.html"
class="link">messages</a> into the incoming queue. If no value for
<i>n</i> is supplied, this call will receive as many <a
href="proton.Message-class.html" class="link">messages</a> as it can
buffer internally. If the <a href="proton.Messenger-class.html"
class="link">Messenger</a> is in blocking mode, this call will block
until at least one <a href="proton.Message-class.html"
class="link">Message</a> is available in the incoming queue.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="work"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">work</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">timeout</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.work">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Sends or receives any outstanding <a href="proton.Message-class.html"
class="link">messages</a> queued for a <a
href="proton.Messenger-class.html" class="link">Messenger</a>. This will
block for the indicated timeout. This method may also do I/O work other
than sending and receiving <a href="proton.Message-class.html"
class="link">messages</a>. For example, closing connections after
messenger.<a href="proton.Messenger-class.html#stop"
class="link">stop</a>() has been called.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="receiving"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">receiving</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.receiving">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="interrupt"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">interrupt</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.interrupt">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>The <a href="proton.Messenger-class.html" class="link">Messenger</a>
interface is single-threaded. This is the only <a
href="proton.Messenger-class.html" class="link">Messenger</a> function
intended to be called from outside of the <a
href="proton.Messenger-class.html" class="link">Messenger</a> thread.
Call this from a non-messenger thread to interrupt a <a
href="proton.Messenger-class.html" class="link">Messenger</a> that is
blocking. This will cause any in-progress blocking call to throw the <a
href="proton.Interrupt-class.html" class="link">Interrupt</a> exception.
If there is no currently blocking call, then the next blocking call will
be affected, even if it is within the same thread that interrupt was
called from.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="get"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">message</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.get">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Moves the message from the head of the incoming message queue into the
supplied message object. Any content in the message will be
overwritten.</p>
<p>A tracker for the incoming <a href="proton.Message-class.html"
class="link">Message</a> is returned. The tracker can later be used to
communicate your acceptance or rejection of the <a
href="proton.Message-class.html" class="link">Message</a>.</p>
<p>If None is passed in for the <a href="proton.Message-class.html"
class="link">Message</a> object, the <a href="proton.Message-class.html"
class="link">Message</a> popped from the head of the queue is
discarded.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>message</code></strong> (Message) - the destination message object</li>
</ul></dd>
<dt>Returns:</dt>
<dd>a tracker</dd>
</dl>
</td></tr></table>
</div>
<a name="accept"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">accept</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">tracker</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.accept">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Signal the sender that you have acted on the <a
href="proton.Message-class.html" class="link">Message</a> pointed to by
the tracker. If no tracker is supplied, then all messages that have been
returned by the <a href="proton.Messenger-class.html#get"
class="link">get</a> method are accepted, except those that have already
been auto-settled by passing beyond your incoming window size.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>tracker</code></strong> (tracker) - a tracker as returned by get</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="reject"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">reject</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">tracker</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.reject">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Rejects the <a href="proton.Message-class.html"
class="link">Message</a> indicated by the tracker. If no tracker is
supplied, all messages that have been returned by the <a
href="proton.Messenger-class.html#get" class="link">get</a> method are
rejected, except those that have already been auto-settled by passing
beyond your outgoing window size.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>tracker</code></strong> (tracker) - a tracker as returned by get</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="outgoing"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">outgoing</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.outgoing">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>The outgoing queue depth.</p>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="incoming"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">incoming</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.incoming">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>The incoming queue depth.</p>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="route"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">route</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">pattern</span>,
<span class="sig-arg">address</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.route">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Adds a routing rule to a <a href="proton.Messenger-class.html"
class="link">Messenger's</a> internal routing table.</p>
<p>The route procedure may be used to influence how a <a
href="proton.Messenger-class.html" class="link">Messenger</a> will
internally treat a given address or class of addresses. Every call to the
route procedure will result in <a href="proton.Messenger-class.html"
class="link">Messenger</a> appending a routing rule to its internal
routing table.</p>
<p>Whenever a <a href="proton.Message-class.html"
class="link">Message</a> is presented to a <a
href="proton.Messenger-class.html" class="link">Messenger</a> for
delivery, it will match the address of this message against the set of
routing rules in order. The first rule to match will be triggered, and
instead of routing based on the address presented in the message, the <a
href="proton.Messenger-class.html" class="link">Messenger</a> will route
based on the address supplied in the rule.</p>
<p>The pattern matching syntax supports two types of matches, a '%' will
match any character except a '/', and a '*' will match any character
including a '/'.</p>
<p>A routing address is specified as a normal AMQP address, however it
may additionally use substitution variables from the pattern match that
triggered the rule.</p>
<p>Any message sent to &quot;foo&quot; will be routed to
&quot;amqp://foo.com&quot;:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;foo&quot;</span>, <span class="py-string">&quot;amqp://foo.com&quot;</span>);</pre>
<p>Any message sent to &quot;foobar&quot; will be routed to
&quot;amqp://foo.com/bar&quot;:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;foobar&quot;</span>, <span class="py-string">&quot;amqp://foo.com/bar&quot;</span>);</pre>
<p>Any message sent to bar/&lt;path&gt; will be routed to the
corresponding path within the amqp://bar.com domain:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;bar/*&quot;</span>, <span class="py-string">&quot;amqp://bar.com/$1&quot;</span>);</pre>
<p>Route all <a href="proton.Message-class.html"
class="link">messages</a> over TLS:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;amqp:*&quot;</span>, <span class="py-string">&quot;amqps:$1&quot;</span>)</pre>
<p>Supply credentials for foo.com:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;amqp://foo.com/*&quot;</span>, <span class="py-string">&quot;amqp://user:password@foo.com/$1&quot;</span>);</pre>
<p>Supply credentials for all domains:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;amqp://*&quot;</span>, <span class="py-string">&quot;amqp://user:password@$1&quot;</span>);</pre>
<p>Route all addresses through a single proxy while preserving the
original destination:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;amqp://%/*&quot;</span>, <span class="py-string">&quot;amqp://user:password@proxy/$1/$2&quot;</span>);</pre>
<p>Route any address through a single broker:</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>messenger.route(<span class="py-string">&quot;*&quot;</span>, <span class="py-string">&quot;amqp://user:password@broker/$1&quot;</span>);</pre>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="rewrite"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">rewrite</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">pattern</span>,
<span class="sig-arg">address</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.rewrite">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Similar to route(), except that the destination of the <a
href="proton.Message-class.html" class="link">Message</a> is determined
before the message address is rewritten.</p>
<p>The outgoing address is only rewritten after routing has been
finalized. If a message has an outgoing address of
&quot;amqp://0.0.0.0:5678&quot;, and a rewriting rule that changes its
outgoing address to &quot;foo&quot;, it will still arrive at the peer
that is listening on &quot;amqp://0.0.0.0:5678&quot;, but when it arrives
there, the receiver will see its outgoing address as &quot;foo&quot;.</p>
<p>The default rewrite rule removes username and password from addresses
before they are transmitted.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="deadline"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">deadline</span>(<span class="sig-arg">self</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="proton-pysrc.html#Messenger.deadline">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<dl class="fields">
<dt>Decorators:</dt>
<dd><ul class="nomargin-top">
<li><code>@property</code></li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== CLASS VARIABLE DETAILS ==================== -->
<a name="section-ClassVariableDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Class Variable Details</span></td>
</tr>
</table>
<a name="certificate"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">certificate</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_certificate, _set_certificate, doc= &quot;&quot;&quot;
Path to a certificate file for the L{Messenger}. This certificate is
used when the L{Messenger} accepts or establishes SSL/TLS connections.
This property must be specified for the L{Messenger} to accept
incoming SSL/TLS connections and to establish client authenticated
outgoing SSL/TLS connection. Non client authenticated outgoing SSL/TLS
connections do not require this property.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="private_key"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">private_key</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_private_key, _set_private_key, doc= &quot;&quot;&quot;
Path to a private key file for the L{Messenger's&lt;Messenger&gt;}
certificate. This property must be specified for the L{Messenger} to
accept incoming SSL/TLS connections and to establish client
authenticated outgoing SSL/TLS connection. Non client authenticated
SSL/TLS connections do not require this property.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="password"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">password</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_password, _set_password, doc= &quot;&quot;&quot;
This property contains the password for the L{Messenger.private_key}
file, or None if the file is not encrypted.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="trusted_certificates"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">trusted_certificates</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_trusted_certificates, _set_trusted_certificates, doc= &quot;&quot;<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
&quot;
A path to a database of trusted certificates for use in verifying the
peer on an SSL/TLS connection. If this property is None, then the peer
will not be verified.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="timeout"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">timeout</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_timeout, _set_timeout, doc= &quot;&quot;&quot;
The timeout property contains the default timeout for blocking
operations performed by the L{Messenger}.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="blocking"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">blocking</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_is_blocking, _set_blocking, doc= &quot;&quot;&quot;
Enable or disable blocking behavior during L{Message} sending
and receiving. This affects every blocking call, with the
exception of L{work}. Currently, the affected calls are
L{send}, L{recv}, and L{stop}.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="passive"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">passive</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_is_passive, _set_passive, doc= &quot;&quot;&quot;
When passive is set to true, Messenger will not attempt to perform I/O
internally. In this mode it is necessary to use the selectables API to
drive any I/O needed to perform requested actions. In this mode
Messenger will never block.
&quot;&quot;&quot;)
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="incoming_window"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">incoming_window</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_incoming_window, _set_incoming_window, doc= &quot;&quot;&quot;
The incoming tracking window for the messenger. The messenger will
track the remote status of this many incoming deliveries after they
have been accepted or rejected. Defaults to zero.
L{Messages&lt;Message&gt;} enter this window only when you take them into yo<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
ur application
using L{get}. If your incoming window size is I{n}, and you get I{n}+<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<a name="outgoing_window"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<h3 class="epydoc">outgoing_window</h3>
<dl class="fields">
</dl>
<dl class="fields">
<dt>Value:</dt>
<dd><table><tr><td><pre class="variable">
property(_get_outgoing_window, _set_outgoing_window, doc= &quot;&quot;&quot;
The outgoing tracking window for the messenger. The messenger will
track the remote status of this many outgoing deliveries after calling
send. Defaults to zero.
A L{Message} enters this window when you call the put() method with th<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
e
message. If your outgoing window size is I{n}, and you call L{put} I{<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="proton-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://qpid.apache.org/index.html">Qpid Proton Python API</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>