FreePastry/html/rawtutorial/tut_cancellable_msg.html

51 lines
2.2 KiB
HTML
Raw Normal View History

2019-05-13 12:45:05 +00:00
<html><head>
<title>FreePastry Tutorial</title>
<link rel="stylesheet" href="tutorial.css" />
</head>
<body>
<div class="content">
<div class="frontmatter">
<h1>The FreePastry Tutorial.</h1>
<div class="abstract">This tutorial is designed to get you cooking quickly with the FreePastry
API and software toolkit.</div>
<h4>Version @tutorial_version@; @tutorial_date@. For <a
href="http://freepastry.org/">FreePastry</a> version @freepastry_version@. Maintained by @maintainer@.</h4>
</div>
<a name="forward"><h1>Cancellable Messages</h1></a>
<h2>Keep track of FreePastry's queue size, and optionally cancel pending messages.</h2>
<div class="nav">
<span class="nav-left"><a href="tut_layers.html#layer">Previous (Transport Layers)</a></span>
<span class="nav-center"><a href="index.html">Contents</a></span>
<span class="nav-right"><a href="index.html">Next (Contents)</a></span>
</div><br/><hr/>
<p/>This tutorial will show you how to keep track of your application's pending messages, and even cancel them.
<p/>This tutorial is currently a stub. The important new feature described here is that <code>Endpoint.route()</code> is overloaded so that now it takes a <code>rice.p2p.commonapi.DeliveryNotification</code> and returns a <code>rice.p2p.commonapi.MessageReceipt</code>.
<p/>You can keep track of how many messages are pending in the queue by storing a list of the MessageReceipts who haven't been acknowledged by calling <code>DeliveryNotification.sent()</code>. If this number gets too high, you can cancel stale messages by calling <code>MessageReceipt.cancel()</code>. You can also be notified of dropped messages because the transport layer will call <code>DeliveryNotification.sendFailed()</code>.
<hr/>
<div class="nav">
<span class="nav-left"><a href="tut_layers.html#layer">Previous (Transport Layers)</a></span>
<span class="nav-center"><a href="index.html">Contents</a></span>
<span class="nav-right"><a href="index.html">Next (Contents)</a></span>
</div><br/>
<div class="footer">
Pastry tutorial version @tutorial_version@. &nbsp;&nbsp;&nbsp; Last updated @tutorial_date@.
&nbsp;&nbsp;&nbsp; For FreePastry @freepastry_version@. &nbsp;&nbsp;&nbsp; Maintained by @maintainer@.
</div>
</div>
</body>
</html>