Skip to content

Commit

Permalink
deploy: 00a9e94
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Oct 2, 2023
1 parent 7296667 commit 3477717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zenoh-kotlin/io.zenoh.subscriber/-subscriber/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="breadcrumbs"><a href="../../../index.html">zenoh-kotlin</a><span class="delimiter">/</span><a href="../index.html">io.zenoh.subscriber</a><span class="delimiter">/</span><span class="current">Subscriber</span></div>
<div class="cover ">
<h1 class="cover"><span><span>Subscriber</span></span></h1>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":zenoh-kotlin:dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="index.html">Subscriber</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="index.html">R</a><span class="token operator">&gt;</span> : <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html">AutoCloseable</a>, <a href="../../io.zenoh/-session-declaration/index.html">SessionDeclaration</a></div><p class="paragraph">A subscriber that allows listening to updates on a key expression and reacting to changes.</p><p class="paragraph">Its main purpose is to keep the subscription active as long as it exists.</p><p class="paragraph">Example using the default <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span> handler:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">Session.open().onSuccess { session -&gt;<br> session.use {<br> &quot;demo/kotlin/sub&quot;.intoKeyExpr().onSuccess { keyExpr -&gt;<br> session.declareSubscriber(keyExpr)<br> .bestEffort()<br> .reliability(Reliability.RELIABLE)<br> .res()<br> .onSuccess { subscriber -&gt;<br> subscriber.use {<br> println(&quot;Declared subscriber on $keyExpr.&quot;)<br> runBlocking {<br> val receiver = subscriber.receiver!!<br> val iterator = receiver.iterator()<br> while (iterator.hasNext()) {<br> val sample = iterator.next()<br> println(sample)<br> }<br> }<br> }<br> }<br> }<br> }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h4 class="">Parameters</h4><div class="table"><div class="table-row" data-filterable-current=":zenoh-kotlin:dokkaHtml/main" data-filterable-set=":zenoh-kotlin:dokkaHtml/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span><span>R</span></span></u></div></span></div><div><div class="title"><p class="paragraph">Receiver type of the <a href="../../io.zenoh.handlers/-handler/index.html">Handler</a> implementation. If no handler is provided to the builder, R will be <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>.</p></div></div></div></div></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":zenoh-kotlin:dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="index.html">Subscriber</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="index.html">R</a><span class="token operator">&gt;</span> : <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html">AutoCloseable</a>, <a href="../../io.zenoh/-session-declaration/index.html">SessionDeclaration</a></div><p class="paragraph">A subscriber that allows listening to updates on a key expression and reacting to changes.</p><p class="paragraph">Its main purpose is to keep the subscription active as long as it exists.</p><p class="paragraph">Example using the default <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span> handler:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">Session.open().onSuccess { session -&gt;<br> session.use {<br> &quot;demo/kotlin/sub&quot;.intoKeyExpr().onSuccess { keyExpr -&gt;<br> session.declareSubscriber(keyExpr)<br> .bestEffort()<br> .res()<br> .onSuccess { subscriber -&gt;<br> subscriber.use {<br> println(&quot;Declared subscriber on $keyExpr.&quot;)<br> runBlocking {<br> val receiver = subscriber.receiver!!<br> val iterator = receiver.iterator()<br> while (iterator.hasNext()) {<br> val sample = iterator.next()<br> println(sample)<br> }<br> }<br> }<br> }<br> }<br> }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h4 class="">Parameters</h4><div class="table"><div class="table-row" data-filterable-current=":zenoh-kotlin:dokkaHtml/main" data-filterable-set=":zenoh-kotlin:dokkaHtml/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span><span>R</span></span></u></div></span></div><div><div class="title"><p class="paragraph">Receiver type of the <a href="../../io.zenoh.handlers/-handler/index.html">Handler</a> implementation. If no handler is provided to the builder, R will be <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>.</p></div></div></div></div></div></div></div>
</div>
<div class="tabbedcontent">
<div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button></div>
Expand Down
2 changes: 1 addition & 1 deletion zenoh-kotlin/io.zenoh/-session/declare-subscriber.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="cover ">
<h1 class="cover"><span>declare</span><wbr></wbr><span><span>Subscriber</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":zenoh-kotlin:dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="declare-subscriber.html"><span class="token function">declareSubscriber</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">keyExpr<span class="token operator">: </span><a href="../../io.zenoh.keyexpr/-key-expr/index.html">KeyExpr</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../../io.zenoh.subscriber/-subscriber/-builder/index.html">Subscriber.Builder</a><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="../../io.zenoh.sample/-sample/index.html">Sample</a><span class="token operator">&gt;</span><span class="token operator">&gt;</span></div><p class="paragraph">Declare a <a href="../../io.zenoh.subscriber/-subscriber/index.html">Subscriber</a> on the session.</p><p class="paragraph">The default receiver is a <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span>, but can be changed with the <a href="../../io.zenoh.subscriber/-subscriber/-builder/with.html">Subscriber.Builder.with</a> functions.</p><p class="paragraph">Example:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">Session.open().onSuccess { session -&gt;<br> session.use {<br> &quot;demo/kotlin/sub&quot;.intoKeyExpr().onSuccess { keyExpr -&gt;<br> session.declareSubscriber(keyExpr)<br> .bestEffort()<br> .reliability(Reliability.RELIABLE)<br> .res()<br> .onSuccess { subscriber -&gt;<br> subscriber.use {<br> println(&quot;Declared subscriber on $keyExpr.&quot;)<br> runBlocking {<br> val receiver = subscriber.receiver!!<br> val iterator = receiver.iterator()<br> while (iterator.hasNext()) {<br> val sample = iterator.next()<br> println(sample)<br> }<br> }<br> }<br> }<br> }<br> }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><span class="kdoc-tag"><h4 class="">Return</h4><p class="paragraph">A <a href="../../io.zenoh.subscriber/-subscriber/-builder/index.html">Subscriber.Builder</a> with a <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span> receiver.</p></span><h4 class="">Parameters</h4><div class="table"><div class="table-row" data-filterable-current=":zenoh-kotlin:dokkaHtml/main" data-filterable-set=":zenoh-kotlin:dokkaHtml/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span>key</span><wbr></wbr><span><span>Expr</span></span></u></div></span></div><div><div class="title"><p class="paragraph">The <a href="../../io.zenoh.keyexpr/-key-expr/index.html">KeyExpr</a> the subscriber will be associated to.</p></div></div></div></div></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":zenoh-kotlin:dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="declare-subscriber.html"><span class="token function">declareSubscriber</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">keyExpr<span class="token operator">: </span><a href="../../io.zenoh.keyexpr/-key-expr/index.html">KeyExpr</a></span></span><span class="token punctuation">)</span><span class="token operator">: </span><a href="../../io.zenoh.subscriber/-subscriber/-builder/index.html">Subscriber.Builder</a><span class="token operator">&lt;</span><span class="token keyword"></span><span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="../../io.zenoh.sample/-sample/index.html">Sample</a><span class="token operator">&gt;</span><span class="token operator">&gt;</span></div><p class="paragraph">Declare a <a href="../../io.zenoh.subscriber/-subscriber/index.html">Subscriber</a> on the session.</p><p class="paragraph">The default receiver is a <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span>, but can be changed with the <a href="../../io.zenoh.subscriber/-subscriber/-builder/with.html">Subscriber.Builder.with</a> functions.</p><p class="paragraph">Example:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">Session.open().onSuccess { session -&gt;<br> session.use {<br> &quot;demo/kotlin/sub&quot;.intoKeyExpr().onSuccess { keyExpr -&gt;<br> session.declareSubscriber(keyExpr)<br> .bestEffort()<br> .res()<br> .onSuccess { subscriber -&gt;<br> subscriber.use {<br> println(&quot;Declared subscriber on $keyExpr.&quot;)<br> runBlocking {<br> val receiver = subscriber.receiver!!<br> val iterator = receiver.iterator()<br> while (iterator.hasNext()) {<br> val sample = iterator.next()<br> println(sample)<br> }<br> }<br> }<br> }<br> }<br> }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><span class="kdoc-tag"><h4 class="">Return</h4><p class="paragraph">A <a href="../../io.zenoh.subscriber/-subscriber/-builder/index.html">Subscriber.Builder</a> with a <span data-unresolved-link="kotlinx.coroutines.channels/Channel///PointingToDeclaration/">Channel</span> receiver.</p></span><h4 class="">Parameters</h4><div class="table"><div class="table-row" data-filterable-current=":zenoh-kotlin:dokkaHtml/main" data-filterable-set=":zenoh-kotlin:dokkaHtml/main"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span>key</span><wbr></wbr><span><span>Expr</span></span></u></div></span></div><div><div class="title"><p class="paragraph">The <a href="../../io.zenoh.keyexpr/-key-expr/index.html">KeyExpr</a> the subscriber will be associated to.</p></div></div></div></div></div></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span
Expand Down

0 comments on commit 3477717

Please sign in to comment.