| |
| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <meta charset="utf-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>API Overview — Qpid Proton Python API 0.32.0 documentation</title> |
| <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
| <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
| <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> |
| <script src="_static/jquery.js"></script> |
| <script src="_static/underscore.js"></script> |
| <script src="_static/doctools.js"></script> |
| <script src="_static/language_data.js"></script> |
| <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> |
| <link rel="index" title="Index" href="genindex.html" /> |
| <link rel="search" title="Search" href="search.html" /> |
| <link rel="next" title="AMQP Types" href="types.html" /> |
| <link rel="prev" title="Module proton.utils" href="proton.utils.html" /> |
| </head><body> |
| <div class="related" role="navigation" aria-label="related navigation"> |
| <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="types.html" title="AMQP Types" |
| accesskey="N">next</a> |</li> |
| <li class="right" > |
| <a href="proton.utils.html" title="Module proton.utils" |
| accesskey="P">previous</a> |</li> |
| <li class="nav-item nav-item-0"><a href="index.html">Qpid Proton Python API 0.32.0 documentation</a> »</li> |
| <li class="nav-item nav-item-this"><a href="">API Overview</a></li> |
| </ul> |
| </div> |
| |
| <div class="document"> |
| <div class="documentwrapper"> |
| <div class="bodywrapper"> |
| <div class="body" role="main"> |
| |
| <div class="section" id="api-overview"> |
| <span id="overview"></span><h1>API Overview<a class="headerlink" href="#api-overview" title="Permalink to this headline">¶</a></h1> |
| <div class="section" id="an-overview-of-the-model"> |
| <h2>An overview of the model<a class="headerlink" href="#an-overview-of-the-model" title="Permalink to this headline">¶</a></h2> |
| <p>Messages are transferred between connected peers over ‘links’. At the |
| sending peer the link is called a sender. At the receiving peer it is |
| called a receiver. Messages are sent by senders and received by |
| receivers. Links may have named ‘source’ and ‘target’ addresses (for |
| example to identify the queue from which message were to be received |
| or to which they were to be sent).</p> |
| <p>Links are established over sessions. Sessions are established over |
| connections. Connections are (generally) established between two |
| uniquely identified containers. Though a connection can have multiple |
| sessions, often this is not needed. The container API allows you to |
| ignore sessions unless you actually require them.</p> |
| <p>The sending of a message over a link is called a delivery. The message |
| is the content sent, including all meta-data such as headers and |
| annotations. The delivery is the protocol exchange associated with the |
| transfer of that content.</p> |
| <p>To indicate that a delivery is complete, either the sender or the |
| receiver ‘settles’ it. When the other side learns that it has been |
| settled, they will no longer communicate about that delivery. The |
| receiver can also indicate whether they accept or reject the |
| message.</p> |
| <p>Three different delivery levels or ‘guarantees’ can be achieved: |
| at-most-once, at-least-once or exactly-once. See |
| <a class="reference internal" href="#delivery-guarantees"><span class="std std-ref">Delivery guarantees</span></a> for more detail.</p> |
| </div> |
| <div class="section" id="a-summary-of-the-most-commonly-used-classes-and-members"> |
| <h2>A summary of the most commonly used classes and members<a class="headerlink" href="#a-summary-of-the-most-commonly-used-classes-and-members" title="Permalink to this headline">¶</a></h2> |
| <p>A brief summary of some of the key classes follows.</p> |
| <p>The <a class="reference internal" href="proton.reactor.html#proton.reactor.Container" title="proton.reactor.Container"><code class="xref py py-class docutils literal notranslate"><span class="pre">Container</span></code></a> class is a convenient entry |
| point into the API, allowing connections and links to be |
| established. Applications are structured as one or more event |
| handlers. Handlers can be set at Container, Connection, or Link |
| scope. Messages are sent by establishing an appropriate sender and |
| invoking its <a class="reference internal" href="proton.html#proton.Sender.send" title="proton.Sender.send"><code class="xref py py-meth docutils literal notranslate"><span class="pre">send()</span></code></a> method. This is |
| typically done when the sender is sendable, a condition indicated by |
| the <a class="reference internal" href="proton.handlers.html#proton.handlers.MessagingHandler.on_sendable" title="proton.handlers.MessagingHandler.on_sendable"><code class="xref py py-meth docutils literal notranslate"><span class="pre">on_sendable()</span></code></a> event, to |
| avoid excessive build up of messages. Messages can be received by |
| establishing an appropriate receiver and handling the |
| <a class="reference internal" href="proton.handlers.html#proton.handlers.MessagingHandler.on_message" title="proton.handlers.MessagingHandler.on_message"><code class="xref py py-meth docutils literal notranslate"><span class="pre">on_message()</span></code></a> event.</p> |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.reactor.</code><code class="sig-name descname">Container</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">handlers</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_reactor.html#Container"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">proton._reactor.Reactor</span></code></p> |
| <p>A representation of the AMQP concept of a ‘container’, which |
| loosely speaking is something that establishes links to or from |
| another container, over which messages are transfered. This is |
| an extension to the Reactor class that adds convenience methods |
| for creating connections and sender- or receiver- links.</p> |
| <dl class="py attribute"> |
| <dt id="proton.reactor.Container.container_id"> |
| <code class="sig-name descname">container_id</code><a class="headerlink" href="#proton.reactor.Container.container_id" title="Permalink to this definition">¶</a></dt> |
| <dd><p>The identifier used to identify this container in any |
| connections it establishes. Container names should be |
| unique. By default a UUID will be used.</p> |
| </dd></dl> |
| |
| <p>The <a class="reference internal" href="proton.reactor.html#proton.reactor.Container.connect" title="proton.reactor.Container.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">connect()</span></code></a> method returns |
| an instance of <a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a>, the |
| <a class="reference internal" href="proton.reactor.html#proton.reactor.Container.create_receiver" title="proton.reactor.Container.create_receiver"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_receiver()</span></code></a> method |
| returns an instance of <a class="reference internal" href="proton.html#proton.Receiver" title="proton.Receiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">Receiver</span></code></a> and the |
| <a class="reference internal" href="proton.reactor.html#proton.reactor.Container.create_sender" title="proton.reactor.Container.create_sender"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_sender()</span></code></a> method |
| returns an instance of <a class="reference internal" href="proton.html#proton.Sender" title="proton.Sender"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sender</span></code></a>.</p> |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">connect</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">url</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">urls</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">address</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">handler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">reconnect</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">heartbeat</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ssl_domain</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_reactor.html#Container.connect"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Initiates the establishment of an AMQP connection.</p> |
| <p>An optional JSON configuration file may be used to specify some connection |
| parameters. If present, these will override some of those given in this call |
| (see note below). Some connection parameters (for SSL/TLS) can only be |
| provided through this file. The configuration file is located by searching |
| for it as follows:</p> |
| <blockquote> |
| <div><ol class="arabic simple"> |
| <li><p>The location set in the environment variable <code class="docutils literal notranslate"><span class="pre">MESSAGING_CONNECT_FILE</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">.connect.json</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">~/.config/messaging/connect.json</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">/etc/messaging/connect.json</span></code></p></li> |
| </ol> |
| </div></blockquote> |
| <p>To use SSL/TLS for encryption (when an <code class="docutils literal notranslate"><span class="pre">amqps</span></code> URL scheme is used), the above |
| configuration file must contain a <code class="docutils literal notranslate"><span class="pre">tls</span></code> submap containing the following |
| configuration entries (See <a class="reference internal" href="proton.html#proton.SSLDomain" title="proton.SSLDomain"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.SSLDomain</span></code></a> for details):</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">ca</span></code>: Path to a database of trusted CAs that the server will advertise.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">cert</span></code>: Path to a file/database containing the identifying certificate.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">key</span></code>: An optional key to access the identifying certificate.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">verify</span></code>: If <code class="docutils literal notranslate"><span class="pre">True</span></code>, verify the peer name |
| (<a class="reference internal" href="proton.html#proton.SSLDomain.VERIFY_PEER_NAME" title="proton.SSLDomain.VERIFY_PEER_NAME"><code class="xref py py-const docutils literal notranslate"><span class="pre">proton.SSLDomain.VERIFY_PEER_NAME</span></code></a>) and certificate using the |
| <code class="docutils literal notranslate"><span class="pre">ca</span></code> above.</p></li> |
| </ul> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>url</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – URL string of process to connect to</p></li> |
| <li><p><strong>urls</strong> (<code class="docutils literal notranslate"><span class="pre">[str,</span> <span class="pre">str,</span> <span class="pre">...]</span></code>) – list of URL strings of process to try to connect to</p></li> |
| <li><p><strong>reconnect</strong> (<a class="reference internal" href="proton.reactor.html#proton.reactor.Backoff" title="proton.reactor.Backoff"><code class="xref py py-class docutils literal notranslate"><span class="pre">Backoff</span></code></a> or <code class="docutils literal notranslate"><span class="pre">bool</span></code>) – Reconnect is enabled by default. You can |
| pass in an instance of <a class="reference internal" href="proton.reactor.html#proton.reactor.Backoff" title="proton.reactor.Backoff"><code class="xref py py-class docutils literal notranslate"><span class="pre">Backoff</span></code></a> to control reconnect behavior. |
| A value of <code class="docutils literal notranslate"><span class="pre">False</span></code> will prevent the library from automatically |
| trying to reconnect if the underlying socket is disconnected |
| before the connection has been closed.</p></li> |
| <li><p><strong>heartbeat</strong> (<code class="docutils literal notranslate"><span class="pre">float</span></code>) – A value in seconds indicating the |
| desired frequency of heartbeats used to test the underlying |
| socket is alive.</p></li> |
| <li><p><strong>ssl_domain</strong> (<a class="reference internal" href="proton.html#proton.SSLDomain" title="proton.SSLDomain"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.SSLDomain</span></code></a>) – SSL configuration.</p></li> |
| <li><p><strong>handler</strong> (Any child of <code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Events.Handler</span></code>) – a connection scoped handler that will be |
| called to process any events in the scope of this connection |
| or its child links.</p></li> |
| <li><p><strong>kwargs</strong> – <ul> |
| <li><p><code class="docutils literal notranslate"><span class="pre">sasl_enabled</span></code> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>), which determines whether a sasl layer |
| is used for the connection.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">allowed_mechs</span></code> (<code class="docutils literal notranslate"><span class="pre">str</span></code>), an optional string specifying the |
| SASL mechanisms allowed for this connection; the value is a |
| space-separated list of mechanism names; the mechanisms allowed |
| by default are determined by your SASL library and system |
| configuration, with two exceptions: <code class="docutils literal notranslate"><span class="pre">GSSAPI</span></code> and <code class="docutils literal notranslate"><span class="pre">GSS-SPNEGO</span></code> |
| are disabled by default; to enable them, you must explicitly add |
| them using this option; clients must set the allowed mechanisms |
| before the outgoing connection is attempted; servers must set |
| them before the listening connection is setup.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">allow_insecure_mechs</span></code> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>), a flag indicating whether insecure |
| mechanisms, such as PLAIN over a non-encrypted socket, are |
| allowed.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">password</span></code> (<code class="docutils literal notranslate"><span class="pre">str</span></code>), the authentication secret. Ignored without <code class="docutils literal notranslate"><span class="pre">user</span></code> |
| kwarg also being present.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">user</span></code> (<code class="docutils literal notranslate"><span class="pre">str</span></code>), the user to authenticate.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">virtual_host</span></code> (<code class="docutils literal notranslate"><span class="pre">str</span></code>), the hostname to set in the Open performative |
| used by peer to determine the correct back-end service for |
| the client; if <code class="docutils literal notranslate"><span class="pre">virtual_host</span></code> is not supplied the host field |
| from the URL is used instead.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">offered_capabilities</span></code>, a list of capabilities being offered to the |
| peer. The list must contain symbols (or strings, which will be converted |
| to symbols).</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">desired_capabilities</span></code>, a list of capabilities desired from the peer. |
| The list must contain symbols (or strings, which will be converted |
| to symbols).</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">properties</span></code>, a list of connection properties. This must be a map |
| with symbol keys (or string keys, which will be converted to symbol keys).</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">sni</span></code> (<code class="docutils literal notranslate"><span class="pre">str</span></code>), a hostname to use with SSL/TLS Server Name Indication (SNI)</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">max_frame_size</span></code> (<code class="docutils literal notranslate"><span class="pre">int</span></code>), the maximum allowable TCP packet size between the |
| peers.</p></li> |
| </ul> |
| </p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>A new connection object.</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Connection</span></code></a></p> |
| </dd> |
| </dl> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>Only one of <code class="docutils literal notranslate"><span class="pre">url</span></code> or <code class="docutils literal notranslate"><span class="pre">urls</span></code> should be specified.</p> |
| </div> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>The following kwargs will be overridden by the values found |
| in the JSON configuration file (if they exist there):</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">password</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">user</span></code></p></li> |
| </ul> |
| <p>and the following kwargs will be overridden by the values found in the <code class="docutils literal notranslate"><span class="pre">sasl</span></code> |
| sub-map of the above configuration file (if they exist there):</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">sasl_enabled</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">allowed_mechs</span></code></p></li> |
| </ul> |
| </div> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">create_receiver</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</span></em>, <em class="sig-param"><span class="n">source</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">target</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dynamic</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">handler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_reactor.html#Container.create_receiver"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Initiates the establishment of a link over which messages can |
| be received (aka a subscription).</p> |
| <p>There are two patterns of use:</p> |
| <p>(1) A connection can be passed as the first argument, in which |
| case the link is established on that connection. In this case |
| the source address can be specified as the second argument (or |
| as a keyword argument). The target address can also be specified |
| if desired.</p> |
| <p>(2) Alternatively a URL can be passed as the first argument. In |
| this case a new connection will be established on which the link |
| will be attached. If a path is specified and the source is not, |
| then the path of the URL is used as the target address.</p> |
| <p>The name of the link may be specified if desired, otherwise a |
| unique name will be generated.</p> |
| <p>Various <a class="reference internal" href="proton.reactor.html#proton.reactor.LinkOption" title="proton.reactor.LinkOption"><code class="xref py py-class docutils literal notranslate"><span class="pre">LinkOption</span></code></a> s can be specified to further control the |
| attachment.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>context</strong> (<a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Connection</span></code></a> or <code class="docutils literal notranslate"><span class="pre">str</span></code>) – A connection object or a URL.</p></li> |
| <li><p><strong>source</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Address of source node.</p></li> |
| <li><p><strong>target</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Address of target node.</p></li> |
| <li><p><strong>name</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Receiver name.</p></li> |
| <li><p><strong>dynamic</strong> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, indicates dynamic creation of the receiver.</p></li> |
| <li><p><strong>handler</strong> (Any child class of <code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Handler</span></code>) – Event handler for this receiver.</p></li> |
| <li><p><strong>options</strong> (<a class="reference internal" href="proton.reactor.html#proton.reactor.ReceiverOption" title="proton.reactor.ReceiverOption"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReceiverOption</span></code></a> or [ReceiverOption, ReceiverOption, …]) – A single option, or a list of receiver options</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>New receiver instance.</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Receiver" title="proton.Receiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Receiver</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">create_sender</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</span></em>, <em class="sig-param"><span class="n">target</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">source</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">handler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">tags</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_reactor.html#Container.create_sender"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Initiates the establishment of a link over which messages can |
| be sent.</p> |
| <p>There are two patterns of use:</p> |
| <ol class="arabic simple"> |
| <li><p>A connection can be passed as the first argument, in which |
| case the link is established on that connection. In this case |
| the target address can be specified as the second argument (or |
| as a keyword argument). The source address can also be specified |
| if desired.</p></li> |
| <li><p>Alternatively a URL can be passed as the first argument. In |
| this case a new connection will be established on which the link |
| will be attached. If a path is specified and the target is not, |
| then the path of the URL is used as the target address.</p></li> |
| </ol> |
| <p>The name of the link may be specified if desired, otherwise a |
| unique name will be generated.</p> |
| <p>Various <a class="reference internal" href="proton.reactor.html#proton.reactor.LinkOption" title="proton.reactor.LinkOption"><code class="xref py py-class docutils literal notranslate"><span class="pre">LinkOption</span></code></a> s can be specified to further control the |
| attachment.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>context</strong> (<a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Connection</span></code></a> or <code class="docutils literal notranslate"><span class="pre">str</span></code>) – A connection object or a URL.</p></li> |
| <li><p><strong>target</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Address of target node.</p></li> |
| <li><p><strong>source</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Address of source node.</p></li> |
| <li><p><strong>name</strong> (<code class="docutils literal notranslate"><span class="pre">str</span></code>) – Sender name.</p></li> |
| <li><p><strong>handler</strong> (Any child class of <code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Handler</span></code>) – Event handler for this sender.</p></li> |
| <li><p><strong>tags</strong> (<em>function pointer</em>) – Function to generate tags for this sender of the form <code class="docutils literal notranslate"><span class="pre">def</span> <span class="pre">simple_tags():</span></code> and returns a <code class="docutils literal notranslate"><span class="pre">bytes</span></code> type</p></li> |
| <li><p><strong>options</strong> (<a class="reference internal" href="proton.reactor.html#proton.reactor.SenderOption" title="proton.reactor.SenderOption"><code class="xref py py-class docutils literal notranslate"><span class="pre">SenderOption</span></code></a> or [SenderOption, SenderOption, …]) – A single option, or a list of sender options</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>New sender instance.</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Sender" title="proton.Sender"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Sender</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span></dt> |
| <dd><p>Start the processing of events and messages for this container.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">delay</span></em>, <em class="sig-param"><span class="n">handler</span></em><span class="sig-paren">)</span></dt> |
| <dd><p>Schedule a task to run on this container after a given delay, |
| and using the supplied handler.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>delay</strong> – </p></li> |
| <li><p><strong>handler</strong> – </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Connection</code><span class="sig-paren">(</span><em class="sig-param">impl=<function pn_connection></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Connection"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>A representation of an AMQP connection.</p> |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Connection.close"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Closes the connection.</p> |
| <p>In more detail, this moves the local state of the connection to |
| the <code class="docutils literal notranslate"><span class="pre">CLOSED</span></code> state and triggers a close frame to be sent to the |
| peer. A connection is fully closed once both peers have closed it.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">container</code></dt> |
| <dd><p>The container name for this connection object.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">hostname</code></dt> |
| <dd><p>Set the name of the host (either fully qualified or relative) to which this |
| connection is connecting to. This information may be used by the remote |
| peer to determine the correct back-end service to connect the client to. |
| This value will be sent in the Open performative, and will be used by SSL |
| and SASL layers to identify the peer.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">open</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Connection.open"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Opens the connection.</p> |
| <p>In more detail, this moves the local state of the connection to |
| the <code class="docutils literal notranslate"><span class="pre">ACTIVE</span></code> state and triggers an open frame to be sent to the |
| peer. A connection is fully active once both peers have opened it.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_container</code></dt> |
| <dd><p>The container identifier specified by the remote peer for this connection.</p> |
| <p>This will return <code class="docutils literal notranslate"><span class="pre">None</span></code> until the :const:’REMOTE_ACTIVE` state is |
| reached. See <a class="reference internal" href="proton.html#proton.Endpoint" title="proton.Endpoint"><code class="xref py py-class docutils literal notranslate"><span class="pre">Endpoint</span></code></a> for more details on endpoint state.</p> |
| <p>Any (non <code class="docutils literal notranslate"><span class="pre">None</span></code>) name returned by this operation will be valid until |
| the connection object is unbound from a transport or freed, |
| whichever happens sooner.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_desired_capabilities</code></dt> |
| <dd><p>The capabilities desired by the remote peer for this connection.</p> |
| <p>This operation will return a <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> object that |
| is valid until the connection object is freed. This <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> |
| object will be empty until the remote connection is opened as |
| indicated by the <a class="reference internal" href="proton.html#proton.Connection.REMOTE_ACTIVE" title="proton.Connection.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> flag.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_hostname</code></dt> |
| <dd><p>The hostname specified by the remote peer for this connection.</p> |
| <p>This will return <code class="docutils literal notranslate"><span class="pre">None</span></code> until the <a class="reference internal" href="proton.html#proton.Connection.REMOTE_ACTIVE" title="proton.Connection.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> state is |
| reached. See <a class="reference internal" href="proton.html#proton.Endpoint" title="proton.Endpoint"><code class="xref py py-class docutils literal notranslate"><span class="pre">Endpoint</span></code></a> for more details on endpoint state.</p> |
| <p>Any (non <code class="docutils literal notranslate"><span class="pre">None</span></code>) name returned by this operation will be valid until |
| the connection object is unbound from a transport or freed, |
| whichever happens sooner.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_offered_capabilities</code></dt> |
| <dd><p>The capabilities offered by the remote peer for this connection.</p> |
| <p>This operation will return a <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> object that |
| is valid until the connection object is freed. This <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> |
| object will be empty until the remote connection is opened as |
| indicated by the <a class="reference internal" href="proton.html#proton.Connection.REMOTE_ACTIVE" title="proton.Connection.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> flag.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_properties</code></dt> |
| <dd><p>The properties specified by the remote peer for this connection.</p> |
| <p>This operation will return a <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> object that |
| is valid until the connection object is freed. This <a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> |
| object will be empty until the remote connection is opened as |
| indicated by the <a class="reference internal" href="proton.html#proton.Connection.REMOTE_ACTIVE" title="proton.Connection.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> flag.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">session</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Connection.session"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Returns a new session on this connection.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Returns</dt> |
| <dd class="field-odd"><p>New session</p> |
| </dd> |
| <dt class="field-even">Return type</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a></p> |
| </dd> |
| <dt class="field-odd">Raises</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.SessionException" title="proton.SessionException"><code class="xref py py-class docutils literal notranslate"><span class="pre">SessionException</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">state</code></dt> |
| <dd><p>The state of the connection as a bit field. The state has a local |
| and a remote component. Each of these can be in one of three |
| states: <code class="docutils literal notranslate"><span class="pre">UNINIT</span></code>, <code class="docutils literal notranslate"><span class="pre">ACTIVE</span></code> or <code class="docutils literal notranslate"><span class="pre">CLOSED</span></code>. These can be tested by masking |
| against <a class="reference internal" href="proton.html#proton.Connection.LOCAL_UNINIT" title="proton.Connection.LOCAL_UNINIT"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_UNINIT</span></code></a>, <a class="reference internal" href="proton.html#proton.Connection.LOCAL_ACTIVE" title="proton.Connection.LOCAL_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_ACTIVE</span></code></a>, <a class="reference internal" href="proton.html#proton.Connection.LOCAL_CLOSED" title="proton.Connection.LOCAL_CLOSED"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_CLOSED</span></code></a>, <a class="reference internal" href="proton.html#proton.Connection.REMOTE_UNINIT" title="proton.Connection.REMOTE_UNINIT"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_UNINIT</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Connection.REMOTE_ACTIVE" title="proton.Connection.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> and <a class="reference internal" href="proton.html#proton.Connection.REMOTE_CLOSED" title="proton.Connection.REMOTE_CLOSED"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_CLOSED</span></code></a>.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Receiver</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Receiver"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">proton._endpoints.Link</span></code></p> |
| <p>A link over which messages are received.</p> |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">drain</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Receiver.drain"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Grant credit for incoming deliveries on this receiver, and |
| set drain mode to true.</p> |
| <p>Use <a class="reference internal" href="proton.html#proton.Receiver.drain_mode" title="proton.Receiver.drain_mode"><code class="xref py py-attr docutils literal notranslate"><span class="pre">drain_mode</span></code></a> to set the drain mode explicitly.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>n</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – The amount by which to increment the link credit</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">draining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Receiver.draining"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Check if a link is currently draining. A link is defined |
| to be draining when drain mode is set to <code class="docutils literal notranslate"><span class="pre">True</span></code>, and the |
| sender still has excess credit.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Returns</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if the link is currently draining, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| </dd> |
| <dt class="field-even">Return type</dt> |
| <dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">flow</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Receiver.flow"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Increases the credit issued to the remote sender by the specified number of messages.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>n</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – The credit to be issued to the remote sender.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">recv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">limit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Receiver.recv"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Receive message data for the current delivery on this receiver.</p> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>The link API can be used to stream large messages across |
| the network, so just because there is no data to read does not |
| imply the message is complete. To ensure the entirety of the |
| message data has been read, either invoke <a class="reference internal" href="proton.html#proton.Receiver.recv" title="proton.Receiver.recv"><code class="xref py py-meth docutils literal notranslate"><span class="pre">recv()</span></code></a> until |
| <code class="docutils literal notranslate"><span class="pre">None</span></code> is returned.</p> |
| </div> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>limit</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – the max data size to receive of this message</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>The received message data, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if the message |
| has been completely received.</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">binary</span></code> or <code class="docutils literal notranslate"><span class="pre">None</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><ul class="simple"> |
| <li><p><a class="reference internal" href="proton.html#proton.Timeout" title="proton.Timeout"><code class="xref py py-class docutils literal notranslate"><span class="pre">Timeout</span></code></a> if timed out</p></li> |
| <li><p><a class="reference internal" href="proton.html#proton.Interrupt" title="proton.Interrupt"><code class="xref py py-class docutils literal notranslate"><span class="pre">Interrupt</span></code></a> if interrupted</p></li> |
| <li><p><a class="reference internal" href="proton.html#proton.LinkException" title="proton.LinkException"><code class="xref py py-class docutils literal notranslate"><span class="pre">LinkException</span></code></a> for all other exceptions</p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Sender</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Sender"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">proton._endpoints.Link</span></code></p> |
| <p>A link over which messages are sent.</p> |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">offered</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Sender.offered"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Signal the availability of deliveries for this Sender.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>n</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – Credit the number of deliveries potentially |
| available for transfer.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">send</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">obj</span></em>, <em class="sig-param"><span class="n">tag</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Sender.send"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>A convenience method to send objects as message content.</p> |
| <p>Send specified object over this sender; the object is expected to |
| have a <code class="docutils literal notranslate"><span class="pre">send()</span></code> method on it that takes the sender and an optional |
| tag as arguments.</p> |
| <p>Where the object is a <a class="reference internal" href="proton.html#proton.Message" title="proton.Message"><code class="xref py py-class docutils literal notranslate"><span class="pre">Message</span></code></a>, this will send the message over |
| this link, creating a new delivery for the purpose.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Link</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Link"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>A representation of an AMQP link (a unidirectional channel for |
| transferring messages), of which there are two concrete |
| implementations, <a class="reference internal" href="proton.html#proton.Sender" title="proton.Sender"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sender</span></code></a> and <a class="reference internal" href="proton.html#proton.Receiver" title="proton.Receiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">Receiver</span></code></a>.</p> |
| <p>The <a class="reference internal" href="proton.html#proton.Link.source" title="proton.Link.source"><code class="xref py py-meth docutils literal notranslate"><span class="pre">source()</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Link.target" title="proton.Link.target"><code class="xref py py-meth docutils literal notranslate"><span class="pre">target()</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Link.remote_source" title="proton.Link.remote_source"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remote_source()</span></code></a> and |
| <a class="reference internal" href="proton.html#proton.Link.remote_target" title="proton.Link.remote_target"><code class="xref py py-meth docutils literal notranslate"><span class="pre">remote_target()</span></code></a> methods all return an |
| instance of <a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a>.</p> |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">connection</code></dt> |
| <dd><p>The connection on which this link was attached.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">credit</code></dt> |
| <dd><p>The amount of outstanding credit on this link.</p> |
| <p>Links use a credit based flow control scheme. Every receiver |
| maintains a credit balance that corresponds to the number of |
| deliveries that the receiver can accept at any given moment. As |
| more capacity becomes available at the receiver (see |
| <a class="reference internal" href="proton.html#proton.Receiver.flow" title="proton.Receiver.flow"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Receiver.flow()</span></code></a>), it adds credit to this balance and |
| communicates the new balance to the sender. Whenever a delivery |
| is sent/received, the credit balance maintained by the link is |
| decremented by one. Once the credit balance at the sender reaches |
| zero, the sender must pause sending until more credit is obtained |
| from the receiver.</p> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>A sending link may still be used to send deliveries even |
| if <a class="reference internal" href="proton.html#proton.Link.credit" title="proton.Link.credit"><code class="xref py py-attr docutils literal notranslate"><span class="pre">credit</span></code></a> reaches zero, however those deliveries will end |
| up being buffered by the link until enough credit is obtained from |
| the receiver to send them over the wire. In this case the balance |
| reported by <a class="reference internal" href="proton.html#proton.Link.credit" title="proton.Link.credit"><code class="xref py py-attr docutils literal notranslate"><span class="pre">credit</span></code></a> will go negative.</p> |
| </div> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">is_receiver</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if this link is a receiver, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">is_sender</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if this link is a sender, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">name</code></dt> |
| <dd><p>The name of the link.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">queued</code></dt> |
| <dd><p>The number of queued deliveries for a link.</p> |
| <p>Links may queue deliveries for a number of reasons, for example |
| there may be insufficient credit to send them to the receiver (see |
| <a class="reference internal" href="proton.html#proton.Link.credit" title="proton.Link.credit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">credit()</span></code></a>), or they simply may not have yet had a chance to |
| be written to the wire. This operation will return the number of |
| queued deliveries on a link.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_source</code></dt> |
| <dd><p>The source of the link as described by the remote peer. The |
| returned object is valid until the link is freed. The remote |
| <a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a> object will be empty until the link is |
| remotely opened as indicated by the <a class="reference internal" href="proton.html#proton.Link.REMOTE_ACTIVE" title="proton.Link.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> |
| flag.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_target</code></dt> |
| <dd><p>The target of the link as described by the remote peer. The |
| returned object is valid until the link is freed. The remote |
| <a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a> object will be empty until the link is |
| remotely opened as indicated by the <a class="reference internal" href="proton.html#proton.Link.REMOTE_ACTIVE" title="proton.Link.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> |
| flag.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">session</code></dt> |
| <dd><p>The parent session for this link.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">source</code></dt> |
| <dd><p>The source of the link as described by the local peer. The |
| returned object is valid until the link is freed.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">state</code></dt> |
| <dd><p>The state of the link as a bit field. The state has a local |
| and a remote component. Each of these can be in one of three |
| states: <code class="docutils literal notranslate"><span class="pre">UNINIT</span></code>, <code class="docutils literal notranslate"><span class="pre">ACTIVE</span></code> or <code class="docutils literal notranslate"><span class="pre">CLOSED</span></code>. These can be |
| tested by masking against <a class="reference internal" href="proton.html#proton.Link.LOCAL_UNINIT" title="proton.Link.LOCAL_UNINIT"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_UNINIT</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Link.LOCAL_ACTIVE" title="proton.Link.LOCAL_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_ACTIVE</span></code></a>, <a class="reference internal" href="proton.html#proton.Link.LOCAL_CLOSED" title="proton.Link.LOCAL_CLOSED"><code class="xref py py-const docutils literal notranslate"><span class="pre">LOCAL_CLOSED</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Link.REMOTE_UNINIT" title="proton.Link.REMOTE_UNINIT"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_UNINIT</span></code></a>, <a class="reference internal" href="proton.html#proton.Link.REMOTE_ACTIVE" title="proton.Link.REMOTE_ACTIVE"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_ACTIVE</span></code></a> and |
| <a class="reference internal" href="proton.html#proton.Link.REMOTE_CLOSED" title="proton.Link.REMOTE_CLOSED"><code class="xref py py-const docutils literal notranslate"><span class="pre">REMOTE_CLOSED</span></code></a>.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">target</code></dt> |
| <dd><p>The target of the link as described by the local peer. The |
| returned object is valid until the link is freed.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Terminus" title="proton.Terminus"><code class="xref py py-class docutils literal notranslate"><span class="pre">Terminus</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Delivery</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_delivery.html#Delivery"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Tracks and/or records the delivery of a message over a link.</p> |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">connection</code></dt> |
| <dd><p>The <a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> over which the delivery was sent or received.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">link</code></dt> |
| <dd><p>The <a class="reference internal" href="proton.html#proton.Link" title="proton.Link"><code class="xref py py-class docutils literal notranslate"><span class="pre">Link</span></code></a> on which the delivery was sent or received.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Link" title="proton.Link"><code class="xref py py-class docutils literal notranslate"><span class="pre">Link</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">local_state</code></dt> |
| <dd><p>A string representation of the local state of the delivery.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">partial</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> for an incoming delivery if not all the data is |
| yet available, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">readable</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> for an incoming delivery that has data to read, |
| <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise..</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">remote_state</code></dt> |
| <dd><p>A string representation of the state of the delivery as |
| indicated by the remote peer.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">session</code></dt> |
| <dd><p>The <a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> over which the delivery was sent or received.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">settle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_delivery.html#Delivery.settle"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Settles the delivery locally. This indicates the application |
| considers the delivery complete and does not wish to receive any |
| further events about it. Every delivery should be settled locally.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">settled</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if the delivery has been settled by the remote peer, |
| <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">state</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_delivery.html#Delivery.update"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Set the local state of the delivery e.g. <a class="reference internal" href="proton.html#proton.Delivery.ACCEPTED" title="proton.Delivery.ACCEPTED"><code class="xref py py-const docutils literal notranslate"><span class="pre">ACCEPTED</span></code></a>, |
| <a class="reference internal" href="proton.html#proton.Delivery.REJECTED" title="proton.Delivery.REJECTED"><code class="xref py py-const docutils literal notranslate"><span class="pre">REJECTED</span></code></a>, <a class="reference internal" href="proton.html#proton.Delivery.RELEASED" title="proton.Delivery.RELEASED"><code class="xref py py-const docutils literal notranslate"><span class="pre">RELEASED</span></code></a>.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>state</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – State of delivery</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">writable</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> for an outgoing delivery to which data can now be written, |
| <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise..</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.handlers.</code><code class="sig-name descname">MessagingHandler</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">prefetch</span><span class="o">=</span><span class="default_value">10</span></em>, <em class="sig-param"><span class="n">auto_accept</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">auto_settle</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">peer_close_is_error</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>A general purpose handler that makes the proton-c events somewhat |
| simpler to deal with and/or avoids repetitive tasks for common use |
| cases.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>prefetch</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code>) – Initial flow credit for receiving messages, defaults to 10.</p></li> |
| <li><p><strong>auto_accept</strong> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, accept all messages (default). Otherwise messages |
| must be individually accepted or rejected.</p></li> |
| <li><p><strong>auto_settle</strong> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, settle all messages (default). Otherwise |
| messages must be explicitly settled.</p></li> |
| <li><p><strong>peer_close_is_error</strong> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, a peer endpoint closing will be |
| treated as an error with an error callback. Otherwise (default), the |
| normal callbacks for the closing will occur.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">accept</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">delivery</span></em><span class="sig-paren">)</span></dt> |
| <dd><p>Accepts a received message.</p> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>This method cannot currently be used in combination |
| with transactions. See <a class="reference internal" href="proton.reactor.html#proton.reactor.Transaction" title="proton.reactor.Transaction"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.reactor.Transaction</span></code></a> |
| for transactional methods.</p> |
| </div> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>delivery</strong> (<a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Delivery</span></code></a>) – The message delivery tracking object</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_accepted</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_accepted"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the remote peer accepts an outgoing message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_connection_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_connection_error"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the peer closes the connection with an error condition.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_disconnected</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_disconnected"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the socket is disconnected.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_link_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_link_error"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the peer closes the link with an error condition.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_message</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_message"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when a message is received. The message itself can be |
| obtained as a property on the event. For the purpose of |
| referring to this message in further actions (e.g. if |
| explicitly accepting it, the <code class="docutils literal notranslate"><span class="pre">delivery</span></code> should be used, also |
| obtainable via a property on the event.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event. In particular, the message itself may |
| be obtained by accessing <code class="docutils literal notranslate"><span class="pre">event.message</span></code>.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_reactor_init</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_reactor_init"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the event loop - the reactor - starts.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_rejected</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_rejected"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the remote peer rejects an outgoing message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_sendable</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_sendable"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the sender link has credit and messages can |
| therefore be transferred.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_session_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_session_error"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the peer closes the session with an error condition.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_settled</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_settled"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the remote peer has settled the outgoing |
| message. This is the point at which it should never be |
| retransmitted.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">on_start</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">event</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_handlers.html#MessagingHandler.on_start"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Called when the event loop starts. (Just an alias for on_reactor_init)</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>event</strong> (<a class="reference internal" href="proton.html#proton.Event" title="proton.Event"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Event</span></code></a>) – The underlying event object. Use this to obtain further |
| information on the event.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">reject</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">delivery</span></em><span class="sig-paren">)</span></dt> |
| <dd><p>Rejects a received message that is considered invalid or |
| unprocessable.</p> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>This method cannot currently be used in combination |
| with transactions. See <a class="reference internal" href="proton.reactor.html#proton.reactor.Transaction" title="proton.reactor.Transaction"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.reactor.Transaction</span></code></a> |
| for transactional methods.</p> |
| </div> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>delivery</strong> (<a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Delivery</span></code></a>) – The message delivery tracking object</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">release</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">delivery</span></em>, <em class="sig-param"><span class="n">delivered</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span></dt> |
| <dd><p>Releases a received message, making it available at the source |
| for any (other) interested receiver. The <code class="docutils literal notranslate"><span class="pre">delivered</span></code> |
| parameter indicates whether this should be considered a |
| delivery attempt (and the delivery count updated) or not.</p> |
| <div class="admonition note"> |
| <p class="admonition-title">Note</p> |
| <p>This method cannot currently be used in combination |
| with transactions. See <a class="reference internal" href="proton.reactor.html#proton.reactor.Transaction" title="proton.reactor.Transaction"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.reactor.Transaction</span></code></a> |
| for transactional methods.</p> |
| </div> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>delivery</strong> (<a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Delivery</span></code></a>) – The message delivery tracking object</p></li> |
| <li><p><strong>delivered</strong> (<code class="docutils literal notranslate"><span class="pre">bool</span></code>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, the message will be annotated |
| with a delivery attempt (setting delivery flag |
| <a class="reference internal" href="proton.html#proton.Delivery.MODIFIED" title="proton.Delivery.MODIFIED"><code class="xref py py-const docutils literal notranslate"><span class="pre">proton.Delivery.MODIFIED</span></code></a>). Otherwise, the message |
| will be returned without the annotation and released (setting |
| delivery flag <a class="reference internal" href="proton.html#proton.Delivery.RELEASED" title="proton.Delivery.RELEASED"><code class="xref py py-const docutils literal notranslate"><span class="pre">proton.Delivery.RELEASED</span></code></a></p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">settle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">delivery</span></em>, <em class="sig-param"><span class="n">state</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span></dt> |
| <dd><p>Settles the message delivery, and optionally updating the |
| delivery state.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>delivery</strong> (<a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">proton.Delivery</span></code></a>) – The message delivery tracking object</p></li> |
| <li><p><strong>state</strong> (<code class="docutils literal notranslate"><span class="pre">int</span></code> or <code class="docutils literal notranslate"><span class="pre">None</span></code>) – The delivery state, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if not update |
| is to be performed.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Event</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em>, <em class="sig-param"><span class="n">number</span></em>, <em class="sig-param"><span class="n">clsname</span></em>, <em class="sig-param"><span class="n">context</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_events.html#Event"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Notification of a state change in the protocol engine.</p> |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">connection</code></dt> |
| <dd><p>The connection associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if none |
| is associated with it.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">context</code></dt> |
| <dd><p>The context object associated with the event.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p>Depends on the type of event, and include the following: |
| - <a class="reference internal" href="proton.html#proton.Connection" title="proton.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> |
| - <a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> |
| - <a class="reference internal" href="proton.html#proton.Link" title="proton.Link"><code class="xref py py-class docutils literal notranslate"><span class="pre">Link</span></code></a> |
| - <a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a> |
| - <a class="reference internal" href="proton.html#proton.Transport" title="proton.Transport"><code class="xref py py-class docutils literal notranslate"><span class="pre">Transport</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">delivery</code></dt> |
| <dd><p>The delivery associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if none |
| is associated with it.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">link</code></dt> |
| <dd><p>The link associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if none |
| is associated with it.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Link" title="proton.Link"><code class="xref py py-class docutils literal notranslate"><span class="pre">Link</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">reactor</code></dt> |
| <dd><p><strong>Deprecated</strong> - The <a class="reference internal" href="proton.reactor.html#proton.reactor.Container" title="proton.reactor.Container"><code class="xref py py-class docutils literal notranslate"><span class="pre">reactor.Container</span></code></a> (was reactor) associated with the event.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">receiver</code></dt> |
| <dd><p>The receiver link associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if |
| none is associated with it. This is essentially an alias for |
| link(), that does an additional check on the type of the link.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Receiver" title="proton.Receiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">Receiver</span></code></a> (<strong><– CHECK!</strong>)</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">sender</code></dt> |
| <dd><p>The sender link associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if |
| none is associated with it. This is essentially an alias for |
| link(), that does an additional check on the type of the |
| link.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Sender" title="proton.Sender"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sender</span></code></a> (<strong><– CHECK!</strong>)</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">session</code></dt> |
| <dd><p>The session associated with the event, or <code class="docutils literal notranslate"><span class="pre">None</span></code> if none |
| is associated with it.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Session" title="proton.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Message</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">body</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_message.html#Message"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>The <a class="reference internal" href="proton.html#proton.Message" title="proton.Message"><code class="xref py py-class docutils literal notranslate"><span class="pre">Message</span></code></a> class is a mutable holder of message content.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Variables</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><a class="reference internal" href="proton.html#proton.Message.instructions" title="proton.Message.instructions"><strong>instructions</strong></a> (<code class="docutils literal notranslate"><span class="pre">dict</span></code>) – delivery instructions for the message (“Delivery Annotations” in the AMQP 1.0 spec)</p></li> |
| <li><p><strong>annotations</strong> (<code class="docutils literal notranslate"><span class="pre">dict</span></code>) – infrastructure defined message annotations (“Message Annotations” in the AMQP 1.0 spec)</p></li> |
| <li><p><strong>properties</strong> (<code class="docutils literal notranslate"><span class="pre">dict</span></code>) – application defined message properties</p></li> |
| <li><p><strong>body</strong> (<em>bytes | unicode | dict | list | int | long | float | UUID</em>) – message body</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Parameters</dt> |
| <dd class="field-even"><p><strong>kwargs</strong> – Message property name/value pairs to initialize the Message</p> |
| </dd> |
| </dl> |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">address</code></dt> |
| <dd><p>The address of the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">content_encoding</code></dt> |
| <dd><p>The content-encoding of the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.symbol" title="proton.symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">symbol</span></code></a></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">content_type</code></dt> |
| <dd><p>The RFC-2046 [RFC2046] MIME type for the message body.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.symbol" title="proton.symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">symbol</span></code></a></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">correlation_id</code></dt> |
| <dd><p>The correlation-id for the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p>The valid AMQP types for a correlation-id are one of:</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> (unsigned)</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">uuid.UUID</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">bytes</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">creation_time</code></dt> |
| <dd><p>The creation time of the message in seconds using the Unix time_t [IEEE1003] encoding.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">decode</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_message.html#Message.decode"><span class="viewcode-link">[source]</span></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">delivery_count</code></dt> |
| <dd><p>The number of delivery attempts made for this message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">durable</code></dt> |
| <dd><p>The durable property indicates that the message should be held durably |
| by any intermediaries taking responsibility for the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">encode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_message.html#Message.encode"><span class="viewcode-link">[source]</span></a></dt> |
| <dd></dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">expiry_time</code></dt> |
| <dd><p>The absolute expiry time of the message in seconds using the Unix time_t [IEEE1003] encoding.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">first_acquirer</code></dt> |
| <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> iff the recipient is the first to acquire the message, |
| <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">group_id</code></dt> |
| <dd><p>The group id of the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">group_sequence</code></dt> |
| <dd><p>The sequence of the message within its group.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">id</code></dt> |
| <dd><p>The globally unique id of the message, and can be used |
| to determine if a received message is a duplicate. The allowed |
| types to set the id are:</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p>The valid AMQP types for an id are one of:</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">int</span></code> (unsigned)</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">uuid.UUID</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">bytes</span></code></p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">priority</code></dt> |
| <dd><p>The relative priority of the message, with higher numbers indicating |
| higher priority. The number of available priorities depends |
| on the implementation, but AMQP defines the default priority as |
| the value <code class="docutils literal notranslate"><span class="pre">4</span></code>. See the |
| <a class="reference external" href="http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-header">OASIS AMQP 1.0 standard</a> |
| for more details on message priority.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">recv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">link</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_message.html#Message.recv"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Receives and decodes the message content for the current <a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a> |
| from the link. Upon success it will return the current delivery |
| for the link. If there is no current delivery, or if the current |
| delivery is incomplete, or if the link is not a receiver, it will |
| return <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>link</strong> (<a class="reference internal" href="proton.html#proton.Link" title="proton.Link"><code class="xref py py-class docutils literal notranslate"><span class="pre">Link</span></code></a>) – The link to receive a message from</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>the delivery associated with the decoded message (or None)</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">reply_to</code></dt> |
| <dd><p>The reply-to address for the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">reply_to_group_id</code></dt> |
| <dd><p>The group-id for any replies.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <code class="sig-name descname">send</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sender</span></em>, <em class="sig-param"><span class="n">tag</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_message.html#Message.send"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>Encodes and sends the message content using the specified sender, |
| and, if present, using the specified tag. Upon success, will |
| return the <a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a> object for the sent message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>sender</strong> (<a class="reference internal" href="proton.html#proton.Sender" title="proton.Sender"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sender</span></code></a>) – The sender to send the message</p></li> |
| <li><p><strong>tag</strong> (<code class="docutils literal notranslate"><span class="pre">bytes</span></code>) – The delivery tag for the sent message</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p>The delivery associated with the sent message</p> |
| </dd> |
| <dt class="field-odd">Return type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Delivery" title="proton.Delivery"><code class="xref py py-class docutils literal notranslate"><span class="pre">Delivery</span></code></a></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">subject</code></dt> |
| <dd><p>The subject of the message.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">ttl</code></dt> |
| <dd><p>The time to live of the message measured in seconds. Expired messages |
| may be dropped.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">user_id</code></dt> |
| <dd><p>The user id of the message creator.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bytes</span></code></p> |
| </dd> |
| <dt class="field-even">Raise</dt> |
| <dd class="field-even"><p><a class="reference internal" href="proton.html#proton.MessageException" title="proton.MessageException"><code class="xref py py-exc docutils literal notranslate"><span class="pre">MessageException</span></code></a> if there is any Proton error when using the setter.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="py class"> |
| <dt> |
| <em class="property">class </em><code class="sig-prename descclassname">proton.</code><code class="sig-name descname">Terminus</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">impl</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/proton/_endpoints.html#Terminus"><span class="viewcode-link">[source]</span></a></dt> |
| <dd><p>A source or target for messages.</p> |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">address</code></dt> |
| <dd><p>The terminus address.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">capabilities</code></dt> |
| <dd><p>Capabilities of the source or target.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> containing an array of <a class="reference internal" href="proton.html#proton.symbol" title="proton.symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">symbol</span></code></a>.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">dynamic</code></dt> |
| <dd><p>The dynamic flag for this terminus object. This indicates if this |
| terminus was dynamically created.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">filter</code></dt> |
| <dd><p>A filter on a source allows the set of messages transfered over |
| the link to be restricted. The symbol-keyed map represents a’ |
| filter set.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> containing a map with <a class="reference internal" href="proton.html#proton.symbol" title="proton.symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">symbol</span></code></a> keys.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt> |
| <em class="property">property </em><code class="sig-name descname">properties</code></dt> |
| <dd><p>Properties of a dynamic source or target.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Type</dt> |
| <dd class="field-odd"><p><a class="reference internal" href="proton.html#proton.Data" title="proton.Data"><code class="xref py py-class docutils literal notranslate"><span class="pre">Data</span></code></a> containing a map with <a class="reference internal" href="proton.html#proton.symbol" title="proton.symbol"><code class="xref py py-class docutils literal notranslate"><span class="pre">symbol</span></code></a> keys.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| </div> |
| <div class="section" id="delivery-guarantees"> |
| <span id="id1"></span><h2>Delivery guarantees<a class="headerlink" href="#delivery-guarantees" title="Permalink to this headline">¶</a></h2> |
| <p>For at-most-once, the sender settles the message as soon as it sends |
| it. If the connection is lost before the message is received by the |
| receiver, the message will not be delivered.</p> |
| <p>For at-least-once, the receiver accepts and settles the message on |
| receipt. If the connection is lost before the sender is informed of |
| the settlement, then the delivery is considered in-doubt and should be |
| retried. This will ensure it eventually gets delivered (provided of |
| course the connection and link can be reestablished). It may mean that |
| it is delivered multiple times though.</p> |
| <p>Finally, for exactly-once, the receiver accepts the message but |
| doesn’t settle it. The sender settles once it is aware that the |
| receiver accepted it. In this way the receiver retains knowledge of an |
| accepted message until it is sure the sender knows it has been |
| accepted. If the connection is lost before settlement, the receiver |
| informs the sender of all the unsettled deliveries it knows about, and |
| from this the sender can deduce which need to be redelivered. The |
| sender likewise informs the receiver which deliveries it knows about, |
| from which the receiver can deduce which have already been settled.</p> |
| </div> |
| </div> |
| |
| |
| <div class="clearer"></div> |
| </div> |
| </div> |
| </div> |
| <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> |
| <div class="sphinxsidebarwrapper"> |
| <h3><a href="index.html">Table of Contents</a></h3> |
| <ul> |
| <li><a class="reference internal" href="#">API Overview</a><ul> |
| <li><a class="reference internal" href="#an-overview-of-the-model">An overview of the model</a></li> |
| <li><a class="reference internal" href="#a-summary-of-the-most-commonly-used-classes-and-members">A summary of the most commonly used classes and members</a></li> |
| <li><a class="reference internal" href="#delivery-guarantees">Delivery guarantees</a></li> |
| </ul> |
| </li> |
| </ul> |
| |
| <h4>Previous topic</h4> |
| <p class="topless"><a href="proton.utils.html" |
| title="previous chapter">Module <code class="docutils literal notranslate"><span class="pre">proton.utils</span></code></a></p> |
| <h4>Next topic</h4> |
| <p class="topless"><a href="types.html" |
| title="next chapter">AMQP Types</a></p> |
| <div role="note" aria-label="source link"> |
| <h3>This Page</h3> |
| <ul class="this-page-menu"> |
| <li><a href="_sources/overview.rst.txt" |
| rel="nofollow">Show Source</a></li> |
| </ul> |
| </div> |
| <div id="searchbox" style="display: none" role="search"> |
| <h3 id="searchlabel">Quick search</h3> |
| <div class="searchformwrapper"> |
| <form class="search" action="search.html" method="get"> |
| <input type="text" name="q" aria-labelledby="searchlabel" /> |
| <input type="submit" value="Go" /> |
| </form> |
| </div> |
| </div> |
| <script>$('#searchbox').show(0);</script> |
| </div> |
| </div> |
| <div class="clearer"></div> |
| </div> |
| <div class="related" role="navigation" aria-label="related navigation"> |
| <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="types.html" title="AMQP Types" |
| >next</a> |</li> |
| <li class="right" > |
| <a href="proton.utils.html" title="Module proton.utils" |
| >previous</a> |</li> |
| <li class="nav-item nav-item-0"><a href="index.html">Qpid Proton Python API 0.32.0 documentation</a> »</li> |
| <li class="nav-item nav-item-this"><a href="">API Overview</a></li> |
| </ul> |
| </div> |
| <div class="footer" role="contentinfo"> |
| © Copyright 2019, Apache Qpid Contributors. |
| Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1. |
| </div> |
| </body> |
| </html> |