1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

updating docs

This commit is contained in:
ainsley
2019-08-13 09:27:52 -05:00
parent 1c3833b7e1
commit 032f3cd171
152 changed files with 180 additions and 177 deletions

View File

@@ -2350,7 +2350,7 @@
<li>Queue/Durable</li>
</ul>
<p>For more details on the various types, check the <a href="../../nats_streaming/channels/subscriptions/subscriptions.html">concepts</a> section.</p>
<p><strong><em>Note: message callbacks are invoked serially, one message at a time. If your application does not care about processing ordering and would prefer the messages to be dispatched concurrently, it is the application responsibility to move them to some internal queue to be picked up by threads/go routines.</em></strong></p>
<p><strong><em>Note: message callbacks are invoked serially, one message at a time. If your application does not care about processing ordering and would prefer the messages to be dispatched concurrently, it is the application&apos;s responsibility to move them to some internal queue to be picked up by threads/go routines.</em></strong></p>
<p>Subscriptions set their starting position on creation using position or time. For example, in Go you can start at:</p>
<ul>
<li>The last message received</li>
@@ -2382,12 +2382,12 @@ sub<span class="token punctuation">,</span> err <span class="token operator">:=<
<span class="token keyword">func</span><span class="token punctuation">(</span>m <span class="token operator">*</span>stan<span class="token punctuation">.</span>Msg<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
stan<span class="token punctuation">.</span><span class="token function">StartAtTime</span><span class="token punctuation">(</span>startTime<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<p>To set the delay after which the server should attempt to redeliver a message for which it has not receive an acknowledgment:</p>
<p>To set the delay after which the server should attempt to redeliver a message for which it has not received an acknowledgment:</p>
<pre class="language-"><code class="lang-go">sub<span class="token punctuation">,</span> err <span class="token operator">:=</span> sc<span class="token punctuation">.</span><span class="token function">Subscribe</span><span class="token punctuation">(</span><span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
<span class="token keyword">func</span><span class="token punctuation">(</span>m <span class="token operator">*</span>stan<span class="token punctuation">.</span>Msg<span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
stan<span class="token punctuation">.</span><span class="token function">AckWait</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token operator">*</span>time<span class="token punctuation">.</span>Second<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<p>When an application wishes to stop receiving, but want to maintain the connection opened, the subscription should be closed. There are two ways to stop a subscription, either &quot;close&quot; it, or &quot;unsubscribe&quot; it. For non durable subscriptions, this is equivalent since the subscription will be completely removed. For durable subscriptions, close means that the server will stop delivering, but remember the durable subscription. Unsubscribe, however, means that the server will remove the state of this subscription.</p>
<p>When an application wishes to stop receiving, but wants to maintain the connection opened, the subscription should be closed. There are two ways to stop a subscription, either &quot;close&quot; it, or &quot;unsubscribe&quot; it. For non durable subscriptions, this is equivalent since the subscription will be completely removed. For durable subscriptions, close means that the server will stop delivering, but remember the durable subscription. Unsubscribe, however, means that the server will remove the state of this subscription.</p>
<p>To simply close:</p>
<pre class="language-"><code class="lang-go">err <span class="token operator">:=</span> sub<span class="token punctuation">.</span><span class="token function">Close</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
@@ -2438,7 +2438,7 @@ sub<span class="token punctuation">,</span> err <span class="token operator">:=<
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Receiving Messages from a Channel","level":"7.4","depth":1,"next":{"title":"Durable Subscriptions","level":"7.5","depth":1,"path":"developer/streaming/durables.md","ref":"developer/streaming/durables.md","articles":[]},"previous":{"title":"Publishing to a Channel","level":"7.3","depth":1,"path":"developer/streaming/publishing.md","ref":"developer/streaming/publishing.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"developer/streaming/receiving.md","mtime":"2019-05-30T22:52:52.237Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-25T22:29:27.003Z"},"basePath":"../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Receiving Messages from a Channel","level":"7.4","depth":1,"next":{"title":"Durable Subscriptions","level":"7.5","depth":1,"path":"developer/streaming/durables.md","ref":"developer/streaming/durables.md","articles":[]},"previous":{"title":"Publishing to a Channel","level":"7.3","depth":1,"path":"developer/streaming/publishing.md","ref":"developer/streaming/publishing.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"","base":"https://github.com/nats-io/docs/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"developer/streaming/receiving.md","mtime":"2019-08-13T14:25:46.278Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-08-13T14:26:56.704Z"},"basePath":"../..","book":{"language":""}});
});
</script>
</div>