Skip to content

Commit d19df61

Browse files
committed
deploy: 885b418
1 parent cf333e6 commit d19df61

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

pr/140/docs/iroh_blobs/util/connection_pool/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A simple iroh connection pool"><title>iroh_blobs::util::connection_pool - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_blobs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_blobs/index.html">iroh_<wbr>blobs</a><span class="version">0.93.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module connection_<wbr>pool</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh_<wbr>blobs::<wbr>util</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_blobs</a>::<wbr><a href="../index.html">util</a></span><h1>Module <span>connection_pool</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_blobs/util/connection_pool.rs.html#1-807">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A simple iroh connection pool</p>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A simple iroh connection pool"><title>iroh_blobs::util::connection_pool - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="iroh_blobs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../iroh_blobs/index.html">iroh_<wbr>blobs</a><span class="version">0.93.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module connection_<wbr>pool</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In iroh_<wbr>blobs::<wbr>util</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../index.html">iroh_blobs</a>::<wbr><a href="../index.html">util</a></span><h1>Module <span>connection_pool</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/iroh_blobs/util/connection_pool.rs.html#1-833">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A simple iroh connection pool</p>
22
<p>Entry point is <a href="struct.ConnectionPool.html" title="struct iroh_blobs::util::connection_pool::ConnectionPool"><code>ConnectionPool</code></a>. You create a connection pool for a specific
33
ALPN and <a href="struct.Options.html" title="struct iroh_blobs::util::connection_pool::Options"><code>Options</code></a>. Then the pool will manage connections for you.</p>
44
<p>Access to connections is via the <a href="struct.ConnectionPool.html#method.get_or_connect" title="method iroh_blobs::util::connection_pool::ConnectionPool::get_or_connect"><code>ConnectionPool::get_or_connect</code></a> method, which

pr/140/docs/src/iroh_blobs/util/connection_pool.rs.html

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,33 @@
805805
<a href="#804" id="804">804</a>
806806
<a href="#805" id="805">805</a>
807807
<a href="#806" id="806">806</a>
808-
<a href="#807" id="807">807</a></pre></div><pre class="rust"><code><span class="doccomment">//! A simple iroh connection pool
808+
<a href="#807" id="807">807</a>
809+
<a href="#808" id="808">808</a>
810+
<a href="#809" id="809">809</a>
811+
<a href="#810" id="810">810</a>
812+
<a href="#811" id="811">811</a>
813+
<a href="#812" id="812">812</a>
814+
<a href="#813" id="813">813</a>
815+
<a href="#814" id="814">814</a>
816+
<a href="#815" id="815">815</a>
817+
<a href="#816" id="816">816</a>
818+
<a href="#817" id="817">817</a>
819+
<a href="#818" id="818">818</a>
820+
<a href="#819" id="819">819</a>
821+
<a href="#820" id="820">820</a>
822+
<a href="#821" id="821">821</a>
823+
<a href="#822" id="822">822</a>
824+
<a href="#823" id="823">823</a>
825+
<a href="#824" id="824">824</a>
826+
<a href="#825" id="825">825</a>
827+
<a href="#826" id="826">826</a>
828+
<a href="#827" id="827">827</a>
829+
<a href="#828" id="828">828</a>
830+
<a href="#829" id="829">829</a>
831+
<a href="#830" id="830">830</a>
832+
<a href="#831" id="831">831</a>
833+
<a href="#832" id="832">832</a>
834+
<a href="#833" id="833">833</a></pre></div><pre class="rust"><code><span class="doccomment">//! A simple iroh connection pool
809835
//!
810836
//! Entry point is [`ConnectionPool`]. You create a connection pool for a specific
811837
//! ALPN and [`Options`]. Then the pool will manage connections for you.
@@ -1611,5 +1637,31 @@
16111637
shutdown_routers(routers).<span class="kw">await</span>;
16121638
<span class="prelude-val">Ok</span>(())
16131639
}
1640+
1641+
<span class="doccomment">/// Check that when a connection is closed, the pool will give you a new
1642+
/// connection next time you want one.
1643+
///
1644+
/// This test fails if the connection watch is disabled.
1645+
</span><span class="attr">#[tokio::test]
1646+
#[traced_test]
1647+
</span><span class="kw">async fn </span>watch_close() -&gt; TestResult&lt;()&gt; {
1648+
<span class="kw">let </span>n = <span class="number">1</span>;
1649+
<span class="kw">let </span>(ids, routers, discovery) = echo_servers(n).<span class="kw">await</span><span class="question-mark">?</span>;
1650+
<span class="kw">let </span>endpoint = iroh::Endpoint::builder()
1651+
.discovery(discovery)
1652+
.bind()
1653+
.<span class="kw">await</span><span class="question-mark">?</span>;
1654+
1655+
<span class="kw">let </span>pool = ConnectionPool::new(endpoint, ECHO_ALPN, test_options());
1656+
<span class="kw">let </span>conn = pool.get_or_connect(ids[<span class="number">0</span>]).<span class="kw">await</span><span class="question-mark">?</span>;
1657+
<span class="kw">let </span>cid1 = conn.stable_id();
1658+
conn.close(<span class="number">0u32</span>.into(), <span class="string">b"test"</span>);
1659+
tokio::time::sleep(Duration::from_millis(<span class="number">500</span>)).<span class="kw">await</span>;
1660+
<span class="kw">let </span>conn = pool.get_or_connect(ids[<span class="number">0</span>]).<span class="kw">await</span><span class="question-mark">?</span>;
1661+
<span class="kw">let </span>cid2 = conn.stable_id();
1662+
<span class="macro">assert_ne!</span>(cid1, cid2);
1663+
shutdown_routers(routers).<span class="kw">await</span>;
1664+
<span class="prelude-val">Ok</span>(())
1665+
}
16141666
}
16151667
</code></pre></div></section></main></body></html>

0 commit comments

Comments
 (0)