| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703 | 
<!DOCTYPE html><!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--><!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--><head>  <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <title>grpc.beta package — grpcio 1.1.0 documentation</title>                          <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />              <link rel="index" title="Index"              href="genindex.html"/>        <link rel="search" title="Search" href="search.html"/>    <link rel="top" title="grpcio 1.1.0 documentation" href="index.html"/>        <link rel="up" title="grpc package" href="grpc.html"/>        <link rel="next" title="grpc.framework package" href="grpc.framework.html"/>        <link rel="prev" title="grpc package" href="grpc.html"/>     <script src="_static/js/modernizr.min.js"></script></head><body class="wy-body-for-nav" role="document">  <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"> grpcio                              </a>                                                <div class="version">                1.1.0              </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" />    <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="main navigation">                                                  <p class="caption"><span class="caption-text">Contents:</span></p><ul class="current"><li class="toctree-l1 current"><a class="reference internal" href="grpc.html">grpc package</a><ul class="current"><li class="toctree-l2 current"><a class="reference internal" href="grpc.html#subpackages">Subpackages</a><ul class="current"><li class="toctree-l3 current"><a class="current reference internal" href="#">grpc.beta package</a><ul><li class="toctree-l4"><a class="reference internal" href="#submodules">Submodules</a></li><li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.implementations">grpc.beta.implementations module</a></li><li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.interfaces">grpc.beta.interfaces module</a></li><li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.utilities">grpc.beta.utilities module</a></li><li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta">Module contents</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="grpc.html#module-grpc">Module contents</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="grpc.html#glossary">Glossary</a></li></ul>                              </div>      </div>    </nav>    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">            <nav class="wy-nav-top" role="navigation" aria-label="top navigation">        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>        <a href="index.html">grpcio</a>      </nav>            <div class="wy-nav-content">        <div class="rst-content">           <div role="navigation" aria-label="breadcrumbs navigation">  <ul class="wy-breadcrumbs">    <li><a href="index.html">Docs</a> »</li>                <li><a href="grpc.html">grpc package</a> »</li>          <li>grpc.beta package</li>      <li class="wy-breadcrumbs-aside">                              <a href="_sources/grpc.beta.rst.txt" rel="nofollow"> View page source</a>                        </li>  </ul>  <hr/></div>          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">           <div itemprop="articleBody">              <div class="section" id="grpc-beta-package"><h1>grpc.beta package<a class="headerlink" href="#grpc-beta-package" title="Permalink to this headline">¶</a></h1><div class="section" id="submodules"><h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2></div><div class="section" id="module-grpc.beta.implementations"><span id="grpc-beta-implementations-module"></span><h2>grpc.beta.implementations module<a class="headerlink" href="#module-grpc.beta.implementations" title="Permalink to this headline">¶</a></h2><p>Entry points into the Beta API of gRPC Python.</p><dl class="class"><dt id="grpc.beta.implementations.Channel"><em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">Channel</code><span class="sig-paren">(</span><em>channel</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#Channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A channel to a remote host through which RPCs may be conducted.</p><p>Only the “subscribe” and “unsubscribe” methods are supported for applicationuse. This class’ instance constructor and all other attributes areunsupported.</p><dl class="method"><dt id="grpc.beta.implementations.Channel.subscribe"><code class="descname">subscribe</code><span class="sig-paren">(</span><em>callback</em>, <em>try_to_connect=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#Channel.subscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel.subscribe" title="Permalink to this definition">¶</a></dt><dd><p>Subscribes to this Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><strong>callback</strong> – A callable to be invoked and passed aninterfaces.ChannelConnectivity identifying this Channel’s connectivity.The callable will be invoked immediately upon subscription and again forevery change to this Channel’s connectivity thereafter until it isunsubscribed.</li><li><strong>try_to_connect</strong> – A boolean indicating whether or not this Channel shouldattempt to connect if it is not already connected and ready to conductRPCs.</li></ul></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.beta.implementations.Channel.unsubscribe"><code class="descname">unsubscribe</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#Channel.unsubscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel.unsubscribe" title="Permalink to this definition">¶</a></dt><dd><p>Unsubscribes a callback from this Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – A callable previously registered with this Channel from havingbeen passed to its “subscribe” method.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.beta.implementations.ServerOptions"><em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">ServerOptions</code><span class="sig-paren">(</span><em>multi_method_implementation</em>, <em>request_deserializers</em>, <em>response_serializers</em>, <em>thread_pool</em>, <em>thread_pool_size</em>, <em>default_timeout</em>, <em>maximum_timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#ServerOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ServerOptions" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating the various options for creation of a Server.</p><p>This class and its instances have no supported interface - it exists to definethe type of its instances and its instances exist to be passed to otherfunctions.</p></dd></dl><dl class="class"><dt id="grpc.beta.implementations.StubOptions"><em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">StubOptions</code><span class="sig-paren">(</span><em>host</em>, <em>request_serializers</em>, <em>response_deserializers</em>, <em>metadata_transformer</em>, <em>thread_pool</em>, <em>thread_pool_size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#StubOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.StubOptions" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating the various options for creation of a Stub.</p><p>This class and its instances have no supported interface - it exists to definethe type of its instances and its instances exist to be passed to otherfunctions.</p></dd></dl><dl class="function"><dt id="grpc.beta.implementations.dynamic_stub"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">dynamic_stub</code><span class="sig-paren">(</span><em>channel</em>, <em>service</em>, <em>cardinalities</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#dynamic_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.dynamic_stub" title="Permalink to this definition">¶</a></dt><dd><p>Creates a face.DynamicStub with which RPCs can be invoked.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>channel</strong> – A Channel for the returned face.DynamicStub to use.</li><li><strong>service</strong> – The package-qualified full name of the service.</li><li><strong>cardinalities</strong> – A dictionary from RPC method name to cardinality.Cardinalityvalue identifying the cardinality of the RPC method.</li><li><strong>options</strong> – An optional StubOptions value further customizing the functionalityof the returned face.DynamicStub.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A face.DynamicStub with which RPCs can be invoked.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.generic_stub"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">generic_stub</code><span class="sig-paren">(</span><em>channel</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#generic_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.generic_stub" title="Permalink to this definition">¶</a></dt><dd><p>Creates a face.GenericStub on which RPCs can be made.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>channel</strong> – A Channel for use by the created stub.</li><li><strong>options</strong> – A StubOptions customizing the created stub.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A face.GenericStub on which RPCs can be made.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.google_call_credentials"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">google_call_credentials</code><span class="sig-paren">(</span><em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#google_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.google_call_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Construct CallCredentials from GoogleCredentials.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>credentials</strong> – A GoogleCredentials object from the oauth2client library.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials object for use in a GRPCCallOptions object.</td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.insecure_channel"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">insecure_channel</code><span class="sig-paren">(</span><em>host</em>, <em>port</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#insecure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.insecure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates an insecure Channel to a remote host.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>host</strong> – The name of the remote host to which to connect.</li><li><strong>port</strong> – The port of the remote host to which to connect.If None only the ‘host’ part will be used.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Channel to the remote host through which RPCs may be conducted.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.secure_channel"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">secure_channel</code><span class="sig-paren">(</span><em>host</em>, <em>port</em>, <em>channel_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#secure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.secure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates a secure Channel to a remote host.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>host</strong> – The name of the remote host to which to connect.</li><li><strong>port</strong> – The port of the remote host to which to connect.If None only the ‘host’ part will be used.</li><li><strong>channel_credentials</strong> – A ChannelCredentials.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A secure Channel to the remote host through which RPCs may be conducted.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.server"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">server</code><span class="sig-paren">(</span><em>service_implementations</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.server" title="Permalink to this definition">¶</a></dt><dd><p>Creates an interfaces.Server with which RPCs can be serviced.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>service_implementations</strong> – A dictionary from service name-method name pair toface.MethodImplementation.</li><li><strong>options</strong> – An optional ServerOptions value further customizing thefunctionality of the returned Server.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.Server with which RPCs can be serviced.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.server_options"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">server_options</code><span class="sig-paren">(</span><em>multi_method_implementation=None</em>, <em>request_deserializers=None</em>, <em>response_serializers=None</em>, <em>thread_pool=None</em>, <em>thread_pool_size=None</em>, <em>default_timeout=None</em>, <em>maximum_timeout=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#server_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.server_options" title="Permalink to this definition">¶</a></dt><dd><p>Creates a ServerOptions value to be passed at server creation.</p><p>All parameters are optional and should always be passed by keyword.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>multi_method_implementation</strong> – A face.MultiMethodImplementation to be calledto service an RPC if the server has no specific method implementation forthe name of the RPC for which service was requested.</li><li><strong>request_deserializers</strong> – A dictionary from service name-method name pair torequest deserialization behavior.</li><li><strong>response_serializers</strong> – A dictionary from service name-method name pair toresponse serialization behavior.</li><li><strong>thread_pool</strong> – A thread pool to use in stubs.</li><li><strong>thread_pool_size</strong> – The size of thread pool to create for use in stubs;ignored if thread_pool has been passed.</li><li><strong>default_timeout</strong> – A duration in seconds to allow for RPC service whenservicing RPCs that did not include a timeout value when invoked.</li><li><strong>maximum_timeout</strong> – A duration in seconds to allow for RPC service whenservicing RPCs no matter what timeout value was passed when the RPC wasinvoked.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StubOptions value created from the passed parameters.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.beta.implementations.stub_options"><code class="descclassname">grpc.beta.implementations.</code><code class="descname">stub_options</code><span class="sig-paren">(</span><em>host=None</em>, <em>request_serializers=None</em>, <em>response_deserializers=None</em>, <em>metadata_transformer=None</em>, <em>thread_pool=None</em>, <em>thread_pool_size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#stub_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.stub_options" title="Permalink to this definition">¶</a></dt><dd><p>Creates a StubOptions value to be passed at stub creation.</p><p>All parameters are optional and should always be passed by keyword.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>host</strong> – A host string to set on RPC calls.</li><li><strong>request_serializers</strong> – A dictionary from service name-method name pair torequest serialization behavior.</li><li><strong>response_deserializers</strong> – A dictionary from service name-method name pair toresponse deserialization behavior.</li><li><strong>metadata_transformer</strong> – A callable that given a metadata object producesanother metadata object to be used in the underlying communication on thewire.</li><li><strong>thread_pool</strong> – A thread pool to use in stubs.</li><li><strong>thread_pool_size</strong> – The size of thread pool to create for use in stubs;ignored if thread_pool has been passed.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StubOptions value created from the passed parameters.</p></td></tr></tbody></table></dd></dl></div><div class="section" id="module-grpc.beta.interfaces"><span id="grpc-beta-interfaces-module"></span><h2>grpc.beta.interfaces module<a class="headerlink" href="#module-grpc.beta.interfaces" title="Permalink to this headline">¶</a></h2><p>Constants and interfaces of the Beta API of gRPC Python.</p><dl class="class"><dt id="grpc.beta.interfaces.GRPCCallOptions"><em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCCallOptions</code><span class="sig-paren">(</span><em>disable_compression</em>, <em>subcall_of</em>, <em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCCallOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCCallOptions" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating gRPC-specific options passed on RPC invocation.</p><p>This class and its instances have no supported interface - it exists todefine the type of its instances and its instances exist to be passed toother functions.</p></dd></dl><dl class="class"><dt id="grpc.beta.interfaces.GRPCInvocationContext"><em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCInvocationContext</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCInvocationContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCInvocationContext" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Exposes gRPC-specific options and behaviors to code invoking RPCs.</p><dl class="method"><dt id="grpc.beta.interfaces.GRPCInvocationContext.disable_next_request_compression"><code class="descname">disable_next_request_compression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCInvocationContext.disable_next_request_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCInvocationContext.disable_next_request_compression" title="Permalink to this definition">¶</a></dt><dd><p>Disables compression of the next request passed by the application.</p></dd></dl></dd></dl><dl class="class"><dt id="grpc.beta.interfaces.GRPCServicerContext"><em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCServicerContext</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Exposes gRPC-specific options and behaviors to code servicing RPCs.</p><dl class="method"><dt id="grpc.beta.interfaces.GRPCServicerContext.disable_next_response_compression"><code class="descname">disable_next_response_compression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext.disable_next_response_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext.disable_next_response_compression" title="Permalink to this definition">¶</a></dt><dd><p>Disables compression of the next response passed by the application.</p></dd></dl><dl class="method"><dt id="grpc.beta.interfaces.GRPCServicerContext.peer"><code class="descname">peer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext.peer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext.peer" title="Permalink to this definition">¶</a></dt><dd><p>Identifies the peer that invoked the RPC being serviced.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A string identifying the peer that invoked the RPC being serviced.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.beta.interfaces.Server"><em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">Server</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Services RPCs.</p><dl class="method"><dt id="grpc.beta.interfaces.Server.add_insecure_port"><code class="descname">add_insecure_port</code><span class="sig-paren">(</span><em>address</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server.add_insecure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.add_insecure_port" title="Permalink to this definition">¶</a></dt><dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p><p>This method may only be called before calling this Server’s start method iscalled.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> – The address for which to open a port.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>An integer port on which RPCs will be serviced after this link has been</dt><dd>started. This is typically the same number as the port number containedin the passed address, but will likely be different if the port numbercontained in the passed address was zero.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.beta.interfaces.Server.add_secure_port"><code class="descname">add_secure_port</code><span class="sig-paren">(</span><em>address</em>, <em>server_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server.add_secure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.add_secure_port" title="Permalink to this definition">¶</a></dt><dd><p>Reserves a port for secure RPC service after this Server becomes active.</p><p>This method may only be called before calling this Server’s start method iscalled.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>address</strong> – The address for which to open a port.</li><li><strong>server_credentials</strong> – A ServerCredentials.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An integer port on which RPCs will be serviced after this link has been</dt><dd><p class="first last">started. This is typically the same number as the port number containedin the passed address, but will likely be different if the port numbercontained in the passed address was zero.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.beta.interfaces.Server.start"><code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.start" title="Permalink to this definition">¶</a></dt><dd><p>Starts this Server’s service of RPCs.</p><p>This method may only be called while the server is not serving RPCs (i.e. itis not idempotent).</p></dd></dl><dl class="method"><dt id="grpc.beta.interfaces.Server.stop"><code class="descname">stop</code><span class="sig-paren">(</span><em>grace</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.stop" title="Permalink to this definition">¶</a></dt><dd><p>Stops this Server’s service of RPCs.</p><p>All calls to this method immediately stop service of new RPCs. When existingRPCs are aborted is controlled by the grace period parameter passed to thismethod.</p><p>This method may be called at any time and is idempotent. Passing a smallergrace value than has been passed in a previous call will have the effect ofstopping the Server sooner. Passing a larger grace value than has beenpassed in a previous call will not have the effect of stopping the serverlater.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>grace</strong> – A duration of time in seconds to allow existing RPCs to completebefore being aborted by this Server’s stopping. May be zero forimmediate abortion of all in-progress RPCs.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A threading.Event that will be set when this Server has completelystopped. The returned event may not be set until after the full graceperiod (if some ongoing RPC continues for the full length of the period)of it may be set much sooner (such as if this Server had no RPCs underwayat the time it was stopped or if all RPCs that it had underway completedvery early in the grace period).</td></tr></tbody></table></dd></dl></dd></dl><dl class="function"><dt id="grpc.beta.interfaces.grpc_call_options"><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">grpc_call_options</code><span class="sig-paren">(</span><em>disable_compression=False</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#grpc_call_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.grpc_call_options" title="Permalink to this definition">¶</a></dt><dd><p>Creates a GRPCCallOptions value to be passed at RPC invocation.</p><p>All parameters are optional and should always be passed by keyword.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><strong>disable_compression</strong> – A boolean indicating whether or not compression shouldbe disabled for the request object of the RPC. Only valid forrequest-unary RPCs.</li><li><strong>credentials</strong> – A CallCredentials object to use for the invoked RPC.</li></ul></td></tr></tbody></table></dd></dl></div><div class="section" id="module-grpc.beta.utilities"><span id="grpc-beta-utilities-module"></span><h2>grpc.beta.utilities module<a class="headerlink" href="#module-grpc.beta.utilities" title="Permalink to this headline">¶</a></h2><p>Utilities for the gRPC Python Beta API.</p><dl class="function"><dt id="grpc.beta.utilities.channel_ready_future"><code class="descclassname">grpc.beta.utilities.</code><code class="descname">channel_ready_future</code><span class="sig-paren">(</span><em>channel</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/utilities.html#channel_ready_future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.utilities.channel_ready_future" title="Permalink to this definition">¶</a></dt><dd><p>Creates a future.Future tracking when an implementations.Channel is ready.</p><p>Cancelling the returned future.Future does not tell the givenimplementations.Channel to abandon attempts it may have been making toconnect; cancelling merely deactivates the return future.Future’ssubscription to the given implementations.Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> – An implementations.Channel.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>A future.Future that matures when the given Channel has connectivity</dt><dd>interfaces.ChannelConnectivity.READY.</dd></dl></td></tr></tbody></table></dd></dl></div><div class="section" id="module-grpc.beta"><span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc.beta" title="Permalink to this headline">¶</a></h2></div></div>           </div>          </div>          <footer>      <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">              <a href="grpc.framework.html" class="btn btn-neutral float-right" title="grpc.framework package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>                    <a href="grpc.html" class="btn btn-neutral" title="grpc package" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>          </div>    <hr/>  <div role="contentinfo">    <p>        © Copyright 2016, The gRPC Authors.    </p>  </div>  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer>        </div>      </div>    </section>  </div>        <script type="text/javascript">        var DOCUMENTATION_OPTIONS = {            URL_ROOT:'./',            VERSION:'1.1.0',            COLLAPSE_INDEX:false,            FILE_SUFFIX:'.html',            HAS_SOURCE:  true        };    </script>      <script type="text/javascript" src="_static/jquery.js"></script>      <script type="text/javascript" src="_static/underscore.js"></script>      <script type="text/javascript" src="_static/doctools.js"></script>          <script type="text/javascript" src="_static/js/theme.js"></script>        <script type="text/javascript">      jQuery(function () {          SphinxRtdTheme.StickyNav.enable();      });  </script>   </body></html>
 |