-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote NIMS package version and update Sphinx generated files in _docs
- Loading branch information
1 parent
583003d
commit 3eea1fd
Showing
96 changed files
with
1,655 additions
and
889 deletions.
There are no files selected for viewing
Binary file added
BIN
+14.4 KB
docs/.doctrees/autoapi/ni_measurementlink_service/_channelpool/index.doctree
Binary file not shown.
Binary file added
BIN
+4.63 KB
docs/.doctrees/autoapi/ni_measurementlink_service/_internal/parameter/_message/index.doctree
Binary file not shown.
Binary file added
BIN
+14.1 KB
...es/autoapi/ni_measurementlink_service/_internal/parameter/_serializer_types/index.doctree
Binary file not shown.
Binary file modified
BIN
+2.07 KB
(100%)
...toapi/ni_measurementlink_service/_internal/parameter/serialization_strategy/index.doctree
Binary file not shown.
Binary file modified
BIN
+4.71 KB
(110%)
docs/.doctrees/autoapi/ni_measurementlink_service/index.doctree
Binary file not shown.
Binary file modified
BIN
+4.98 KB
(110%)
docs/.doctrees/autoapi/ni_measurementlink_service/measurement/info/index.doctree
Binary file not shown.
Binary file modified
BIN
-10.1 KB
(86%)
docs/.doctrees/autoapi/ni_measurementlink_service/measurement/service/index.doctree
Binary file not shown.
Binary file modified
BIN
+2.94 KB
(100%)
docs/.doctrees/autoapi/ni_measurementlink_service/session_management/index.doctree
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
docs/_modules/ni_measurementlink_service/_channelpool.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>ni_measurementlink_service._channelpool — ni_measurementlink_service 1.2 documentation</title> | ||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" /> | ||
<!--[if lt IE 9]> | ||
<script src="../../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script> | ||
<script src="../../_static/jquery.js"></script> | ||
<script src="../../_static/underscore.js"></script> | ||
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script> | ||
<script src="../../_static/doctools.js"></script> | ||
<script src="../../_static/sphinx_highlight.js"></script> | ||
<script src="../../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="../../index.html" class="icon icon-home"> | ||
ni_measurementlink_service | ||
</a> | ||
<div class="version"> | ||
1.2.0-dev2 | ||
</div> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../autoapi/index.html">API Reference</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../../index.html">ni_measurementlink_service</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li> | ||
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li> | ||
<li class="breadcrumb-item active">ni_measurementlink_service._channelpool</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>Source code for ni_measurementlink_service._channelpool</h1><div class="highlight"><pre> | ||
<span></span><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">annotations</span> | ||
|
||
<span class="kn">import</span> <span class="nn">sys</span> | ||
<span class="kn">from</span> <span class="nn">threading</span> <span class="kn">import</span> <span class="n">Lock</span> | ||
<span class="kn">from</span> <span class="nn">types</span> <span class="kn">import</span> <span class="n">TracebackType</span> | ||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="p">(</span> | ||
<span class="n">Dict</span><span class="p">,</span> | ||
<span class="n">Literal</span><span class="p">,</span> | ||
<span class="n">Optional</span><span class="p">,</span> | ||
<span class="n">Type</span><span class="p">,</span> | ||
<span class="n">TYPE_CHECKING</span><span class="p">,</span> | ||
<span class="p">)</span> | ||
|
||
<span class="kn">import</span> <span class="nn">grpc</span> | ||
|
||
<span class="kn">from</span> <span class="nn">ni_measurementlink_service._loggers</span> <span class="kn">import</span> <span class="n">ClientLogger</span> | ||
|
||
<span class="k">if</span> <span class="n">TYPE_CHECKING</span><span class="p">:</span> | ||
<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">version_info</span> <span class="o">>=</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">11</span><span class="p">):</span> | ||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Self</span> | ||
<span class="k">else</span><span class="p">:</span> | ||
<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">Self</span> | ||
|
||
|
||
<div class="viewcode-block" id="GrpcChannelPool"><a class="viewcode-back" href="../../autoapi/ni_measurementlink_service/_channelpool/index.html#ni_measurementlink_service._channelpool.GrpcChannelPool">[docs]</a><span class="k">class</span> <span class="nc">GrpcChannelPool</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""Class that manages gRPC channel lifetimes."""</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Initialize the GrpcChannelPool object."""</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span> <span class="n">Lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">grpc</span><span class="o">.</span><span class="n">Channel</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> | ||
|
||
<div class="viewcode-block" id="GrpcChannelPool.__enter__"><a class="viewcode-back" href="../../autoapi/ni_measurementlink_service/_channelpool/index.html#ni_measurementlink_service._channelpool.GrpcChannelPool.__enter__">[docs]</a> <span class="k">def</span> <span class="fm">__enter__</span><span class="p">(</span><span class="bp">self</span><span class="p">:</span> <span class="n">Self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Self</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Enter the runtime context of the GrpcChannelPool."""</span> | ||
<span class="k">return</span> <span class="bp">self</span></div> | ||
|
||
<div class="viewcode-block" id="GrpcChannelPool.__exit__"><a class="viewcode-back" href="../../autoapi/ni_measurementlink_service/_channelpool/index.html#ni_measurementlink_service._channelpool.GrpcChannelPool.__exit__">[docs]</a> <span class="k">def</span> <span class="fm">__exit__</span><span class="p">(</span> | ||
<span class="bp">self</span><span class="p">,</span> | ||
<span class="n">exc_type</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Type</span><span class="p">[</span><span class="ne">BaseException</span><span class="p">]],</span> | ||
<span class="n">exc_val</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="ne">BaseException</span><span class="p">],</span> | ||
<span class="n">traceback</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">TracebackType</span><span class="p">],</span> | ||
<span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">[</span><span class="kc">False</span><span class="p">]:</span> | ||
<span class="w"> </span><span class="sd">"""Exit the runtime context of the GrpcChannelPool."""</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | ||
<span class="k">return</span> <span class="kc">False</span></div> | ||
|
||
<div class="viewcode-block" id="GrpcChannelPool.get_channel"><a class="viewcode-back" href="../../autoapi/ni_measurementlink_service/_channelpool/index.html#ni_measurementlink_service._channelpool.GrpcChannelPool.get_channel">[docs]</a> <span class="k">def</span> <span class="nf">get_channel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="n">grpc</span><span class="o">.</span><span class="n">Channel</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Return a gRPC channel.</span> | ||
|
||
<span class="sd"> Args:</span> | ||
<span class="sd"> target (str): The server address</span> | ||
|
||
<span class="sd"> """</span> | ||
<span class="n">new_channel</span> <span class="o">=</span> <span class="kc">None</span> | ||
<span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span> | ||
<span class="k">if</span> <span class="n">target</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="p">:</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="o">.</span><span class="n">release</span><span class="p">()</span> | ||
<span class="n">new_channel</span> <span class="o">=</span> <span class="n">grpc</span><span class="o">.</span><span class="n">insecure_channel</span><span class="p">(</span><span class="n">target</span><span class="p">)</span> | ||
<span class="k">if</span> <span class="n">ClientLogger</span><span class="o">.</span><span class="n">is_enabled</span><span class="p">():</span> | ||
<span class="n">new_channel</span> <span class="o">=</span> <span class="n">grpc</span><span class="o">.</span><span class="n">intercept_channel</span><span class="p">(</span><span class="n">new_channel</span><span class="p">,</span> <span class="n">ClientLogger</span><span class="p">())</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="o">.</span><span class="n">acquire</span><span class="p">()</span> | ||
<span class="k">if</span> <span class="n">target</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="p">:</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="p">[</span><span class="n">target</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_channel</span> | ||
<span class="n">new_channel</span> <span class="o">=</span> <span class="kc">None</span> | ||
<span class="n">channel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="p">[</span><span class="n">target</span><span class="p">]</span> | ||
|
||
<span class="c1"># Close new_channel if it was not stored in _channel_cache.</span> | ||
<span class="k">if</span> <span class="n">new_channel</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">new_channel</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | ||
|
||
<span class="k">return</span> <span class="n">channel</span></div> | ||
|
||
<div class="viewcode-block" id="GrpcChannelPool.close"><a class="viewcode-back" href="../../autoapi/ni_measurementlink_service/_channelpool/index.html#ni_measurementlink_service._channelpool.GrpcChannelPool.close">[docs]</a> <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Close channels opened by get_channel()."""</span> | ||
<span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span> | ||
<span class="k">for</span> <span class="n">channel</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="o">.</span><span class="n">values</span><span class="p">():</span> | ||
<span class="n">channel</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_channel_cache</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span></div></div> | ||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2023, National Instruments.</p> | ||
</div> | ||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a | ||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> | ||
provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.