| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561 | 
<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8" />    <meta name="viewport" content="width=device-width, initial-scale=1.0" />    <title>gRPC AsyncIO API — gRPC Python 1.32.0 documentation</title>    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>    <script src="_static/jquery.js"></script>    <script src="_static/underscore.js"></script>    <script src="_static/doctools.js"></script>    <script src="_static/language_data.js"></script>    <link rel="index" title="Index" href="genindex.html" />    <link rel="search" title="Search" href="search.html" />    <link rel="next" title="gRPC Channelz" href="grpc_channelz.html" />    <link rel="prev" title="gRPC" href="grpc.html" />     <link rel="stylesheet" href="_static/custom.css" type="text/css" />      <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />  </head><body>  <div class="document">          <div class="sphinxsidebar" role="navigation" aria-label="main navigation">        <div class="sphinxsidebarwrapper"><h1 class="logo"><a href="index.html">gRPC Python</a></h1><p class="blurb">1.32.0</p><h3>Navigation</h3><p class="caption"><span class="caption-text">Contents:</span></p><ul class="current"><li class="toctree-l1"><a class="reference internal" href="grpc.html">gRPC</a></li><li class="toctree-l1 current"><a class="current reference internal" href="#">gRPC AsyncIO API</a><ul><li class="toctree-l2"><a class="reference internal" href="#overview">Overview</a></li><li class="toctree-l2"><a class="reference internal" href="#caveats">Caveats</a></li><li class="toctree-l2"><a class="reference internal" href="#blocking-code-in-asyncio">Blocking Code in AsyncIO</a></li><li class="toctree-l2"><a class="reference internal" href="#module-contents">Module Contents</a><ul><li class="toctree-l3"><a class="reference internal" href="#create-channel">Create Channel</a></li><li class="toctree-l3"><a class="reference internal" href="#channel-object">Channel Object</a></li><li class="toctree-l3"><a class="reference internal" href="#create-server">Create Server</a></li><li class="toctree-l3"><a class="reference internal" href="#server-object">Server Object</a></li><li class="toctree-l3"><a class="reference internal" href="#grpc-exceptions">gRPC Exceptions</a></li><li class="toctree-l3"><a class="reference internal" href="#shared-context">Shared Context</a></li><li class="toctree-l3"><a class="reference internal" href="#client-side-context">Client-Side Context</a></li><li class="toctree-l3"><a class="reference internal" href="#server-side-context">Server-Side Context</a></li><li class="toctree-l3"><a class="reference internal" href="#client-side-interceptor">Client-Side Interceptor</a></li><li class="toctree-l3"><a class="reference internal" href="#multi-callable-interfaces">Multi-Callable Interfaces</a></li></ul></li></ul></li><li class="toctree-l1"><a class="reference internal" href="grpc_channelz.html">gRPC Channelz</a></li><li class="toctree-l1"><a class="reference internal" href="grpc_health_checking.html">gRPC Health Checking</a></li><li class="toctree-l1"><a class="reference internal" href="grpc_reflection.html">gRPC Reflection</a></li><li class="toctree-l1"><a class="reference internal" href="grpc_status.html">gRPC Status</a></li><li class="toctree-l1"><a class="reference internal" href="grpc_testing.html">gRPC Testing</a></li><li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li></ul><div class="relations"><h3>Related Topics</h3><ul>  <li><a href="index.html">Documentation overview</a><ul>      <li>Previous: <a href="grpc.html" title="previous chapter">gRPC</a></li>      <li>Next: <a href="grpc_channelz.html" title="next chapter">gRPC Channelz</a></li>  </ul></li></ul></div><div id="searchbox" style="display: none" role="search">  <h3 id="searchlabel">Quick search</h3>    <div class="searchformwrapper">    <form class="search" action="search.html" method="get">      <input type="text" name="q" aria-labelledby="searchlabel" />      <input type="submit" value="Go" />    </form>    </div></div><script>$('#searchbox').show(0);</script>        </div>      </div>      <div class="documentwrapper">        <div class="bodywrapper">                    <div class="body" role="main">              <div class="section" id="module-grpc.experimental.aio"><span id="grpc-asyncio-api"></span><h1>gRPC AsyncIO API<a class="headerlink" href="#module-grpc.experimental.aio" title="Permalink to this headline">¶</a></h1><div class="section" id="overview"><h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2><p>gRPC AsyncIO API is the <strong>new version</strong> of gRPC Python whose architecture istailored to AsyncIO. Underlying, it utilizes the same C-extension, gRPC C-Core,as existing stack, and it replaces all gRPC IO operations with methods providedby the AsyncIO library.</p><p>This stack currently is under active development. Feel free to offersuggestions by opening issues on our GitHub repo <a class="reference external" href="https://github.com/grpc/grpc">grpc/grpc</a>.</p><p>The design doc can be found here as <a class="reference external" href="https://github.com/grpc/proposal/pull/155">gRFC</a>.</p></div><div class="section" id="caveats"><h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2><p>gRPC Async API objects may only be used on the thread on which they werecreated. AsyncIO doesn’t provide thread safety for most of its APIs.</p></div><div class="section" id="blocking-code-in-asyncio"><h2>Blocking Code in AsyncIO<a class="headerlink" href="#blocking-code-in-asyncio" title="Permalink to this headline">¶</a></h2><p>Making blocking function calls in coroutines or in the thread running eventloop will block the event loop, potentially starving all RPCs in the process.Refer to the Python language documentation on AsyncIO for more details (<a class="reference external" href="https://docs.python.org/3/library/asyncio-dev.html#running-blocking-code">running-blocking-code</a>).</p></div><div class="section" id="module-contents"><h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalink to this headline">¶</a></h2><div class="section" id="create-channel"><h3>Create Channel<a class="headerlink" href="#create-channel" title="Permalink to this headline">¶</a></h3><p>Channels are the abstraction of clients, where most of networking logichappens, for example, managing one or more underlying connections, nameresolution, load balancing, flow control, etc.. If you are using ProtoBuf,Channel objects works best when further encapsulate into stub objects, then theapplication can invoke remote functions as if they are local functions.</p><dl class="py function"><dt id="grpc.experimental.aio.insecure_channel"><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">insecure_channel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">target</span></em>, <em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">interceptors</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_channel.html#insecure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.insecure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates an insecure asynchronous Channel to a server.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>target</strong> (<em>str</em>) – The server address</p></li><li><p><strong>options</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>Tuple</em><em>[</em><em>str</em><em>, </em><em>Any</em><em>]</em><em>]</em><em>]</em>) – An optional list of key-value pairs (<a class="reference internal" href="glossary.html#term-channel_arguments"><span class="xref std std-term">channel_arguments</span></a>in gRPC Core runtime) to configure the channel.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An optional value indicating the compression method to beused over the lifetime of the channel. This is an EXPERIMENTAL option.</p></li><li><p><strong>interceptors</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>grpc.aio._interceptor.ClientInterceptor</em><em>]</em><em>]</em>) – An optional sequence of interceptors that will be executed forany call executed with this channel.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A Channel.</p></dd></dl></dd></dl><dl class="py function"><dt id="grpc.experimental.aio.secure_channel"><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">secure_channel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">target</span></em>, <em class="sig-param"><span class="n">credentials</span></em>, <em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">interceptors</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_channel.html#secure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.secure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates a secure asynchronous Channel to a server.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>target</strong> (<em>str</em>) – The server address.</p></li><li><p><strong>credentials</strong> (<a class="reference internal" href="grpc.html#grpc.ChannelCredentials" title="grpc.ChannelCredentials"><em>grpc.ChannelCredentials</em></a>) – A ChannelCredentials instance.</p></li><li><p><strong>options</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>Tuple</em><em>[</em><em>str</em><em>, </em><em>Any</em><em>]</em><em>]</em><em>]</em>) – An optional list of key-value pairs (<a class="reference internal" href="glossary.html#term-channel_arguments"><span class="xref std std-term">channel_arguments</span></a>in gRPC Core runtime) to configure the channel.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An optional value indicating the compression method to beused over the lifetime of the channel. This is an EXPERIMENTAL option.</p></li><li><p><strong>interceptors</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>grpc.aio._interceptor.ClientInterceptor</em><em>]</em><em>]</em>) – An optional sequence of interceptors that will be executed forany call executed with this channel.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>An aio.Channel.</p></dd></dl></dd></dl></div><div class="section" id="channel-object"><h3>Channel Object<a class="headerlink" href="#channel-object" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.Channel"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">Channel</code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel" title="Permalink to this definition">¶</a></dt><dd><p>Enables asynchronous RPC invocation as a client.</p><p>Channel objects implement the Asynchronous Context Manager (aka. asyncwith) type, although they are not supportted to be entered and exitedmultiple times.</p><dl class="py method"><dt id="grpc.experimental.aio.Channel.__aenter__"><em class="property">abstract async </em><code class="sig-name descname">__aenter__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.__aenter__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.__aenter__" title="Permalink to this definition">¶</a></dt><dd><p>Starts an asynchronous context manager.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>Channel the channel that was instantiated.</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.__aexit__"><em class="property">abstract async </em><code class="sig-name descname">__aexit__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">exc_type</span></em>, <em class="sig-param"><span class="n">exc_val</span></em>, <em class="sig-param"><span class="n">exc_tb</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.__aexit__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.__aexit__" title="Permalink to this definition">¶</a></dt><dd><p>Finishes the asynchronous context manager by closing the channel.</p><p>Still active RPCs will be cancelled.</p></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.channel_ready"><em class="property">abstract async </em><code class="sig-name descname">channel_ready</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.channel_ready"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.channel_ready" title="Permalink to this definition">¶</a></dt><dd><p>Creates a coroutine that blocks until the Channel is READY.</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.close"><em class="property">abstract async </em><code class="sig-name descname">close</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">grace</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.close" title="Permalink to this definition">¶</a></dt><dd><p>Closes this Channel and releases all resources held by it.</p><p>This method immediately stops the channel from executing new RPCs inall cases.</p><p>If a grace period is specified, this method wait until all activeRPCs are finshed, once the grace period is reached the ones that haven’tbeen terminated are cancelled. If a grace period is not specified(by passing None for grace), all existing RPCs are cancelled immediately.</p><p>This method is idempotent.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>grace</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – </p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.get_state"><em class="property">abstract </em><code class="sig-name descname">get_state</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">try_to_connect</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.get_state"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.get_state" title="Permalink to this definition">¶</a></dt><dd><p>Checks the connectivity state of a channel.</p><p>This is an EXPERIMENTAL API.</p><p>If the channel reaches a stable connectivity state, it is guaranteedthat the return value of this function will eventually converge to thatstate.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>try_to_connect</strong> (<em>bool</em>) – a bool indicate whether the Channel should try toconnect to peer or not.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p><a class="reference internal" href="grpc.html#grpc.ChannelConnectivity" title="grpc.ChannelConnectivity">grpc.ChannelConnectivity</a></p></dd></dl><p>Returns: A ChannelConnectivity object.</p></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.stream_stream"><em class="property">abstract </em><code class="sig-name descname">stream_stream</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">request_serializer</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">response_deserializer</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.stream_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.stream_stream" title="Permalink to this definition">¶</a></dt><dd><p>Creates a StreamStreamMultiCallable for a stream-stream method.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>method</strong> (<em>str</em>) – The name of the RPC method.</p></li><li><p><strong>request_serializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>bytes</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-serializer"><span class="xref std std-term">serializer</span></a> for serializing the requestmessage. Request goes unserialized in case None is passed.</p></li><li><p><strong>response_deserializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>bytes</em><em>]</em><em>, </em><em>Any</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-deserializer"><span class="xref std std-term">deserializer</span></a> for deserializing theresponse message. Response goes undeserialized in case Noneis passed.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A StreamStreamMultiCallable value for the named stream-stream method.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>grpc.aio._base_channel.StreamStreamMultiCallable</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.stream_unary"><em class="property">abstract </em><code class="sig-name descname">stream_unary</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">request_serializer</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">response_deserializer</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.stream_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.stream_unary" title="Permalink to this definition">¶</a></dt><dd><p>Creates a StreamUnaryMultiCallable for a stream-unary method.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>method</strong> (<em>str</em>) – The name of the RPC method.</p></li><li><p><strong>request_serializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>bytes</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-serializer"><span class="xref std std-term">serializer</span></a> for serializing the requestmessage. Request goes unserialized in case None is passed.</p></li><li><p><strong>response_deserializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>bytes</em><em>]</em><em>, </em><em>Any</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-deserializer"><span class="xref std std-term">deserializer</span></a> for deserializing theresponse message. Response goes undeserialized in case Noneis passed.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A StreamUnaryMultiCallable value for the named stream-unary method.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>grpc.aio._base_channel.StreamUnaryMultiCallable</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.unary_stream"><em class="property">abstract </em><code class="sig-name descname">unary_stream</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">request_serializer</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">response_deserializer</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.unary_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.unary_stream" title="Permalink to this definition">¶</a></dt><dd><p>Creates a UnaryStreamMultiCallable for a unary-stream method.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>method</strong> (<em>str</em>) – The name of the RPC method.</p></li><li><p><strong>request_serializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>bytes</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-serializer"><span class="xref std std-term">serializer</span></a> for serializing the requestmessage. Request goes unserialized in case None is passed.</p></li><li><p><strong>response_deserializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>bytes</em><em>]</em><em>, </em><em>Any</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-deserializer"><span class="xref std std-term">deserializer</span></a> for deserializing theresponse message. Response goes undeserialized in case Noneis passed.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A UnarySteramMultiCallable value for the named unary-stream method.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>grpc.aio._base_channel.UnaryStreamMultiCallable</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.unary_unary"><em class="property">abstract </em><code class="sig-name descname">unary_unary</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">request_serializer</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">response_deserializer</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.unary_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.unary_unary" title="Permalink to this definition">¶</a></dt><dd><p>Creates a UnaryUnaryMultiCallable for a unary-unary method.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>method</strong> (<em>str</em>) – The name of the RPC method.</p></li><li><p><strong>request_serializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>bytes</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-serializer"><span class="xref std std-term">serializer</span></a> for serializing the requestmessage. Request goes unserialized in case None is passed.</p></li><li><p><strong>response_deserializer</strong> (<em>Optional</em><em>[</em><em>Callable</em><em>[</em><em>[</em><em>bytes</em><em>]</em><em>, </em><em>Any</em><em>]</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-deserializer"><span class="xref std std-term">deserializer</span></a> for deserializing theresponse message. Response goes undeserialized in case Noneis passed.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A UnaryUnaryMultiCallable value for the named unary-unary method.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>grpc.aio._base_channel.UnaryUnaryMultiCallable</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Channel.wait_for_state_change"><em class="property">abstract async </em><code class="sig-name descname">wait_for_state_change</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">last_observed_state</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.wait_for_state_change"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Channel.wait_for_state_change" title="Permalink to this definition">¶</a></dt><dd><p>Waits for a change in connectivity state.</p><p>This is an EXPERIMENTAL API.</p><p>The function blocks until there is a change in the channel connectivitystate from the “last_observed_state”. If the state is alreadydifferent, this function will return immediately.</p><p>There is an inherent race between the invocation of“Channel.wait_for_state_change” and “Channel.get_state”. The state canchange arbitrary many times during the race, so there is no way toobserve every state transition.</p><p>If there is a need to put a timeout for this function, please refer to“asyncio.wait_for”.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>last_observed_state</strong> (<a class="reference internal" href="grpc.html#grpc.ChannelConnectivity" title="grpc.ChannelConnectivity"><em>grpc.ChannelConnectivity</em></a>) – A grpc.ChannelConnectivity object representingthe last known state.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="create-server"><h3>Create Server<a class="headerlink" href="#create-server" title="Permalink to this headline">¶</a></h3><dl class="py function"><dt id="grpc.experimental.aio.server"><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">server</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">migration_thread_pool</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">handlers</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">interceptors</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">options</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">maximum_concurrent_rpcs</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_server.html#server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.server" title="Permalink to this definition">¶</a></dt><dd><p>Creates a Server with which RPCs can be serviced.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>migration_thread_pool</strong> (<em>Optional</em><em>[</em><em>concurrent.futures._base.Executor</em><em>]</em>) – A futures.ThreadPoolExecutor to be used by theServer to execute non-AsyncIO RPC handlers for migration purpose.</p></li><li><p><strong>handlers</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><a class="reference internal" href="grpc.html#grpc.GenericRpcHandler" title="grpc.GenericRpcHandler"><em>grpc.GenericRpcHandler</em></a><em>]</em><em>]</em>) – An optional list of GenericRpcHandlers used for executing RPCs.More handlers may be added by calling add_generic_rpc_handlers any timebefore the server is started.</p></li><li><p><strong>interceptors</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>Any</em><em>]</em><em>]</em>) – An optional list of ServerInterceptor objects that observeand optionally manipulate the incoming RPCs before handing them over tohandlers. The interceptors are given control in the order they arespecified. This is an EXPERIMENTAL API.</p></li><li><p><strong>options</strong> (<em>Optional</em><em>[</em><em>Sequence</em><em>[</em><em>Tuple</em><em>[</em><em>str</em><em>, </em><em>Any</em><em>]</em><em>]</em><em>]</em>) – An optional list of key-value pairs (<a class="reference internal" href="glossary.html#term-channel_arguments"><span class="xref std std-term">channel_arguments</span></a> in gRPC runtime)to configure the channel.</p></li><li><p><strong>maximum_concurrent_rpcs</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – The maximum number of concurrent RPCs this serverwill service before returning RESOURCE_EXHAUSTED status, or None toindicate no limit.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An element of grpc.compression, e.g.grpc.compression.Gzip. This compression algorithm will be used for thelifetime of the server unless overridden by set_compression. This is anEXPERIMENTAL option.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A Server object.</p></dd></dl></dd></dl></div><div class="section" id="server-object"><h3>Server Object<a class="headerlink" href="#server-object" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.Server"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">Server</code><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server" title="Permalink to this definition">¶</a></dt><dd><p>Serves RPCs.</p><dl class="py method"><dt id="grpc.experimental.aio.Server.add_generic_rpc_handlers"><em class="property">abstract </em><code class="sig-name descname">add_generic_rpc_handlers</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">generic_rpc_handlers</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.add_generic_rpc_handlers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.add_generic_rpc_handlers" title="Permalink to this definition">¶</a></dt><dd><p>Registers GenericRpcHandlers with this Server.</p><p>This method is only safe to call before the server is started.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>generic_rpc_handlers</strong> (<em>Sequence</em><em>[</em><a class="reference internal" href="grpc.html#grpc.GenericRpcHandler" title="grpc.GenericRpcHandler"><em>grpc.GenericRpcHandler</em></a><em>]</em>) – A sequence of GenericRpcHandlers that will be</p></li><li><p><strong>to service RPCs.</strong> (<em>used</em>) – </p></li></ul></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Server.add_insecure_port"><em class="property">abstract </em><code class="sig-name descname">add_insecure_port</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">address</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.add_insecure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.add_insecure_port" title="Permalink to this definition">¶</a></dt><dd><p>Opens an insecure port for accepting RPCs.</p><p>A port is a communication endpoint that used by networking protocols,like TCP and UDP. To date, we only support TCP.</p><p>This method may only be called before starting the server.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>address</strong> (<em>str</em>) – The address for which to open a port. If the port is 0,or not specified in the address, then the gRPC runtime will choose a port.</p></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>An integer port on which the server will accept RPC requests.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>int</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Server.add_secure_port"><em class="property">abstract </em><code class="sig-name descname">add_secure_port</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">address</span></em>, <em class="sig-param"><span class="n">server_credentials</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.add_secure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.add_secure_port" title="Permalink to this definition">¶</a></dt><dd><p>Opens a secure port for accepting RPCs.</p><p>A port is a communication endpoint that used by networking protocols,like TCP and UDP. To date, we only support TCP.</p><p>This method may only be called before starting the server.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>address</strong> (<em>str</em>) – The address for which to open a port.if the port is 0, or not specified in the address, then the gRPCruntime will choose a port.</p></li><li><p><strong>server_credentials</strong> (<a class="reference internal" href="grpc.html#grpc.ServerCredentials" title="grpc.ServerCredentials"><em>grpc.ServerCredentials</em></a>) – A ServerCredentials object.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>An integer port on which the server will accept RPC requests.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>int</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Server.start"><em class="property">abstract async </em><code class="sig-name descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.start" title="Permalink to this definition">¶</a></dt><dd><p>Starts this Server.</p><p>This method may only be called once. (i.e. it is not idempotent).</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Server.stop"><em class="property">abstract async </em><code class="sig-name descname">stop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">grace</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.stop" title="Permalink to this definition">¶</a></dt><dd><p>Stops this Server.</p><p>This method immediately stops the server from servicing new RPCs inall cases.</p><p>If a grace period is specified, this method returns immediately and allRPCs active at the end of the grace period are aborted. If a graceperiod is not specified (by passing None for grace), all existing RPCsare aborted immediately and this method blocks until the last RPChandler terminates.</p><p>This method is idempotent and may be called at any time. Passing asmaller grace value in a subsequent call will have the effect ofstopping the Server sooner (passing None will have the effect ofstopping the server immediately). Passing a larger grace value in asubsequent call will not have the effect of stopping the server later(i.e. the most restrictive grace value is used).</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>grace</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – A duration of time in seconds or None.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Server.wait_for_termination"><em class="property">abstract async </em><code class="sig-name descname">wait_for_termination</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.wait_for_termination"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Server.wait_for_termination" title="Permalink to this definition">¶</a></dt><dd><p>Continues current coroutine once the server stops.</p><p>This is an EXPERIMENTAL API.</p><p>The wait will not consume computational resources during blocking, andit will block until one of the two following conditions are met:</p><ol class="arabic simple"><li><p>The server is stopped or terminated;</p></li><li><p>A timeout occurs if timeout is not <cite>None</cite>.</p></li></ol><p>The timeout argument works in the same way as <cite>threading.Event.wait()</cite>.<a class="reference external" href="https://docs.python.org/3/library/threading.html#threading.Event.wait">https://docs.python.org/3/library/threading.html#threading.Event.wait</a></p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>timeout</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – A floating point number specifying a timeout for theoperation in seconds.</p></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A bool indicates if the operation times out.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>bool</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="grpc-exceptions"><h3>gRPC Exceptions<a class="headerlink" href="#grpc-exceptions" title="Permalink to this headline">¶</a></h3><dl class="py exception"><dt id="grpc.experimental.aio.BaseError"><em class="property">exception </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">BaseError</code><a class="headerlink" href="#grpc.experimental.aio.BaseError" title="Permalink to this definition">¶</a></dt><dd><p>The base class for exceptions generated by gRPC AsyncIO stack.</p></dd></dl><dl class="py exception"><dt id="grpc.experimental.aio.UsageError"><em class="property">exception </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UsageError</code><a class="headerlink" href="#grpc.experimental.aio.UsageError" title="Permalink to this definition">¶</a></dt><dd><p>Raised when the usage of API by applications is inappropriate.</p><p>For example, trying to invoke RPC on a closed channel, mixing two stylesof streaming API on the client side. This exception should not besuppressed.</p></dd></dl><dl class="py exception"><dt id="grpc.experimental.aio.AbortError"><em class="property">exception </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">AbortError</code><a class="headerlink" href="#grpc.experimental.aio.AbortError" title="Permalink to this definition">¶</a></dt><dd><p>Raised when calling abort in servicer methods.</p><p>This exception should not be suppressed. Applications may catch it toperform certain clean-up logic, and then re-raise it.</p></dd></dl><dl class="py exception"><dt id="grpc.experimental.aio.InternalError"><em class="property">exception </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">InternalError</code><a class="headerlink" href="#grpc.experimental.aio.InternalError" title="Permalink to this definition">¶</a></dt><dd><p>Raised upon unexpected errors in native code.</p></dd></dl><dl class="py exception"><dt id="grpc.experimental.aio.AioRpcError"><em class="property">exception </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">AioRpcError</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">code</span></em>, <em class="sig-param"><span class="n">initial_metadata</span></em>, <em class="sig-param"><span class="n">trailing_metadata</span></em>, <em class="sig-param"><span class="n">details</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">debug_error_string</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError" title="Permalink to this definition">¶</a></dt><dd><p>An implementation of RpcError to be used by the asynchronous API.</p><p>Raised RpcError is a snapshot of the final status of the RPC, values aredetermined. Hence, its methods no longer needs to be coroutines.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>code</strong> (<a class="reference internal" href="grpc.html#grpc.StatusCode" title="grpc.StatusCode"><em>grpc.StatusCode</em></a>) – </p></li><li><p><strong>initial_metadata</strong> (<em>grpc.aio._metadata.Metadata</em>) – </p></li><li><p><strong>trailing_metadata</strong> (<em>grpc.aio._metadata.Metadata</em>) – </p></li><li><p><strong>details</strong> (<em>Optional</em><em>[</em><em>str</em><em>]</em>) – </p></li><li><p><strong>debug_error_string</strong> (<em>Optional</em><em>[</em><em>str</em><em>]</em>) – </p></li></ul></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.AioRpcError.code"><code class="sig-name descname">code</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError.code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError.code" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the status code sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The <cite>grpc.StatusCode</cite> status code.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p><a class="reference internal" href="grpc.html#grpc.StatusCode" title="grpc.StatusCode">grpc.StatusCode</a></p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.AioRpcError.debug_error_string"><code class="sig-name descname">debug_error_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError.debug_error_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError.debug_error_string" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the debug error string sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The debug error string received.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>str</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.AioRpcError.details"><code class="sig-name descname">details</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError.details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError.details" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the details sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The description of the error.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[str]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.AioRpcError.initial_metadata"><code class="sig-name descname">initial_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError.initial_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError.initial_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the initial metadata sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The initial metadata received.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._metadata.Metadata</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.AioRpcError.trailing_metadata"><code class="sig-name descname">trailing_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError.trailing_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.AioRpcError.trailing_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the trailing metadata sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The trailing metadata received.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._metadata.Metadata</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="shared-context"><h3>Shared Context<a class="headerlink" href="#shared-context" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.RpcContext"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">RpcContext</code><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext" title="Permalink to this definition">¶</a></dt><dd><p>Provides RPC-related information and action.</p><dl class="py method"><dt id="grpc.experimental.aio.RpcContext.add_done_callback"><em class="property">abstract </em><code class="sig-name descname">add_done_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">callback</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext.add_done_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext.add_done_callback" title="Permalink to this definition">¶</a></dt><dd><p>Registers a callback to be called on RPC termination.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>callback</strong> (<em>Callable</em><em>[</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>None</em><em>]</em>) – A callable object will be called with the call object as</p></li><li><p><strong>only argument.</strong> (<em>its</em>) – </p></li></ul></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.RpcContext.cancel"><em class="property">abstract </em><code class="sig-name descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext.cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext.cancel" title="Permalink to this definition">¶</a></dt><dd><p>Cancels the RPC.</p><p>Idempotent and has no effect if the RPC has already terminated.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A bool indicates if the cancellation is performed or not.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>bool</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.RpcContext.cancelled"><em class="property">abstract </em><code class="sig-name descname">cancelled</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext.cancelled"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext.cancelled" title="Permalink to this definition">¶</a></dt><dd><p>Return True if the RPC is cancelled.</p><p>The RPC is cancelled when the cancellation was requested with cancel().</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A bool indicates whether the RPC is cancelled or not.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>bool</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.RpcContext.done"><em class="property">abstract </em><code class="sig-name descname">done</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext.done"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext.done" title="Permalink to this definition">¶</a></dt><dd><p>Return True if the RPC is done.</p><p>An RPC is done if the RPC is completed, cancelled or aborted.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A bool indicates if the RPC is done.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>bool</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.RpcContext.time_remaining"><em class="property">abstract </em><code class="sig-name descname">time_remaining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext.time_remaining"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.RpcContext.time_remaining" title="Permalink to this definition">¶</a></dt><dd><p>Describes the length of allowed time remaining for the RPC.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A nonnegative float indicating the length of allowed time in secondsremaining for the RPC to complete before it is considered to havetimed out, or None if no deadline was specified for the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[float]</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="client-side-context"><h3>Client-Side Context<a class="headerlink" href="#client-side-context" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.Call"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">Call</code><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call" title="Permalink to this definition">¶</a></dt><dd><p>The abstract base class of an RPC on the client-side.</p><dl class="py method"><dt id="grpc.experimental.aio.Call.code"><em class="property">abstract async </em><code class="sig-name descname">code</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call.code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call.code" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the status code sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The StatusCode value for the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p><a class="reference internal" href="grpc.html#grpc.StatusCode" title="grpc.StatusCode">grpc.StatusCode</a></p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Call.details"><em class="property">abstract async </em><code class="sig-name descname">details</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call.details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call.details" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the details sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The details string of the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>str</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Call.initial_metadata"><em class="property">abstract async </em><code class="sig-name descname">initial_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call.initial_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call.initial_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the initial metadata sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The initial <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._metadata.Metadata</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Call.trailing_metadata"><em class="property">abstract async </em><code class="sig-name descname">trailing_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call.trailing_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call.trailing_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the trailing metadata sent by the server.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The trailing <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._metadata.Metadata</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.Call.wait_for_connection"><em class="property">abstract async </em><code class="sig-name descname">wait_for_connection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call.wait_for_connection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.Call.wait_for_connection" title="Permalink to this definition">¶</a></dt><dd><p>Waits until connected to peer and raises aio.AioRpcError if failed.</p><p>This is an EXPERIMENTAL method.</p><p>This method ensures the RPC has been successfully connected. Otherwise,an AioRpcError will be raised to explain the reason of the connectionfailure.</p><p>This method is recommended for building retry mechanisms.</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.UnaryUnaryCall"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UnaryUnaryCall</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryUnaryCall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryCall" title="Permalink to this definition">¶</a></dt><dd><p>The abstract base class of an unary-unary RPC on the client-side.</p><dl class="py method"><dt id="grpc.experimental.aio.UnaryUnaryCall.__await__"><em class="property">abstract </em><code class="sig-name descname">__await__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryUnaryCall.__await__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryCall.__await__" title="Permalink to this definition">¶</a></dt><dd><p>Await the response message to be ready.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The response message of the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Awaitable[ResponseType]</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.UnaryStreamCall"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UnaryStreamCall</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryStreamCall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryStreamCall" title="Permalink to this definition">¶</a></dt><dd><dl class="py method"><dt id="grpc.experimental.aio.UnaryStreamCall.__aiter__"><em class="property">abstract </em><code class="sig-name descname">__aiter__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryStreamCall.__aiter__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryStreamCall.__aiter__" title="Permalink to this definition">¶</a></dt><dd><p>Returns the async iterable representation that yields messages.</p><p>Under the hood, it is calling the “read” method.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>An async iterable object that yields messages.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>AsyncIterable[ResponseType]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.UnaryStreamCall.read"><em class="property">abstract async </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryStreamCall.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryStreamCall.read" title="Permalink to this definition">¶</a></dt><dd><p>Reads one message from the stream.</p><p>Read operations must be serialized when called from multiplecoroutines.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A response message, or an <cite>grpc.aio.EOF</cite> to indicate the end of thestream.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Union[grpc._cython.cygrpc._EOF, ResponseType]</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.StreamUnaryCall"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">StreamUnaryCall</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryCall" title="Permalink to this definition">¶</a></dt><dd><dl class="py method"><dt id="grpc.experimental.aio.StreamUnaryCall.__await__"><em class="property">abstract </em><code class="sig-name descname">__await__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall.__await__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryCall.__await__" title="Permalink to this definition">¶</a></dt><dd><p>Await the response message to be ready.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The response message of the stream.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Awaitable[ResponseType]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.StreamUnaryCall.done_writing"><em class="property">abstract async </em><code class="sig-name descname">done_writing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall.done_writing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryCall.done_writing" title="Permalink to this definition">¶</a></dt><dd><p>Notifies server that the client is done sending messages.</p><p>After done_writing is called, any additional invocation to the writefunction will fail. This function is idempotent.</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.StreamUnaryCall.write"><em class="property">abstract async </em><code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryCall.write" title="Permalink to this definition">¶</a></dt><dd><p>Writes one message to the stream.</p><dl class="field-list simple"><dt class="field-odd">Raises</dt><dd class="field-odd"><p><strong>An RpcError exception if the write failed.</strong> – </p></dd><dt class="field-even">Parameters</dt><dd class="field-even"><p><strong>request</strong> (<em>RequestType</em>) – </p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.StreamStreamCall"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">StreamStreamCall</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamCall" title="Permalink to this definition">¶</a></dt><dd><dl class="py method"><dt id="grpc.experimental.aio.StreamStreamCall.__aiter__"><em class="property">abstract </em><code class="sig-name descname">__aiter__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall.__aiter__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamCall.__aiter__" title="Permalink to this definition">¶</a></dt><dd><p>Returns the async iterable representation that yields messages.</p><p>Under the hood, it is calling the “read” method.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>An async iterable object that yields messages.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>AsyncIterable[ResponseType]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.StreamStreamCall.done_writing"><em class="property">abstract async </em><code class="sig-name descname">done_writing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall.done_writing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamCall.done_writing" title="Permalink to this definition">¶</a></dt><dd><p>Notifies server that the client is done sending messages.</p><p>After done_writing is called, any additional invocation to the writefunction will fail. This function is idempotent.</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.StreamStreamCall.read"><em class="property">abstract async </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamCall.read" title="Permalink to this definition">¶</a></dt><dd><p>Reads one message from the stream.</p><p>Read operations must be serialized when called from multiplecoroutines.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A response message, or an <cite>grpc.aio.EOF</cite> to indicate the end of thestream.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Union[grpc._cython.cygrpc._EOF, ResponseType]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.StreamStreamCall.write"><em class="property">abstract async </em><code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamCall.write" title="Permalink to this definition">¶</a></dt><dd><p>Writes one message to the stream.</p><dl class="field-list simple"><dt class="field-odd">Raises</dt><dd class="field-odd"><p><strong>An RpcError exception if the write failed.</strong> – </p></dd><dt class="field-even">Parameters</dt><dd class="field-even"><p><strong>request</strong> (<em>RequestType</em>) – </p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="server-side-context"><h3>Server-Side Context<a class="headerlink" href="#server-side-context" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.ServicerContext"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">ServicerContext</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext" title="Permalink to this definition">¶</a></dt><dd><p>A context object passed to method implementations.</p><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.abort"><em class="property">abstract async </em><code class="sig-name descname">abort</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">code</span></em>, <em class="sig-param"><span class="n">details</span></em>, <em class="sig-param"><span class="n">trailing_metadata</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.abort"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.abort" title="Permalink to this definition">¶</a></dt><dd><p>Raises an exception to terminate the RPC with a non-OK status.</p><p>The code and details passed as arguments will supercede any existingones.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>code</strong> (<a class="reference internal" href="grpc.html#grpc.StatusCode" title="grpc.StatusCode"><em>grpc.StatusCode</em></a>) – A StatusCode object to be sent to the client.It must not be StatusCode.OK.</p></li><li><p><strong>details</strong> (<em>str</em>) – A UTF-8-encodable string to be sent to the client upontermination of the RPC.</p></li><li><p><strong>trailing_metadata</strong> (<em>grpc.aio._metadata.Metadata</em>) – A sequence of tuple represents the trailing<a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></li></ul></dd><dt class="field-even">Raises</dt><dd class="field-even"><p><strong>Exception</strong> – An exception is always raised to signal the abortion the    RPC to the gRPC runtime.</p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.auth_context"><em class="property">abstract </em><code class="sig-name descname">auth_context</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.auth_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.auth_context" title="Permalink to this definition">¶</a></dt><dd><p>Gets the auth context for the call.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A map of strings to an iterable of bytes for each auth property.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Mapping[str, Iterable[bytes]]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.disable_next_message_compression"><em class="property">abstract </em><code class="sig-name descname">disable_next_message_compression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.disable_next_message_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.disable_next_message_compression" title="Permalink to this definition">¶</a></dt><dd><p>Disables compression for the next response message.</p><p>This is an EXPERIMENTAL method.</p><p>This method will override any compression configuration set duringserver creation or set on the call.</p><dl class="field-list simple"><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.invocation_metadata"><em class="property">abstract </em><code class="sig-name descname">invocation_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.invocation_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.invocation_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the metadata from the sent by the client.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The invocation <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[grpc.aio._metadata.Metadata]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.peer"><em class="property">abstract </em><code class="sig-name descname">peer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.peer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.peer" title="Permalink to this definition">¶</a></dt><dd><p>Identifies the peer that invoked the RPC being serviced.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A string identifying the peer that invoked the RPC being serviced.The string format is determined by gRPC runtime.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>str</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.peer_identities"><em class="property">abstract </em><code class="sig-name descname">peer_identities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.peer_identities"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.peer_identities" title="Permalink to this definition">¶</a></dt><dd><p>Gets one or more peer identity(s).</p><p>Equivalent toservicer_context.auth_context().get(servicer_context.peer_identity_key())</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>An iterable of the identities, or None if the call is notauthenticated. Each identity is returned as a raw bytes type.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[Iterable[bytes]]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.peer_identity_key"><em class="property">abstract </em><code class="sig-name descname">peer_identity_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.peer_identity_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.peer_identity_key" title="Permalink to this definition">¶</a></dt><dd><p>The auth property used to identify the peer.</p><p>For example, “x509_common_name” or “x509_subject_alternative_name” areused to identify an SSL peer.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>The auth property (string) that indicates thepeer identity, or None if the call is not authenticated.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[str]</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.read"><em class="property">abstract async </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.read" title="Permalink to this definition">¶</a></dt><dd><p>Reads one message from the RPC.</p><p>Only one read operation is allowed simultaneously.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A response message of the RPC.</p></dd><dt class="field-even">Raises</dt><dd class="field-even"><p><strong>An RpcError exception if the read failed.</strong> – </p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>RequestType</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.send_initial_metadata"><em class="property">abstract async </em><code class="sig-name descname">send_initial_metadata</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">initial_metadata</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.send_initial_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.send_initial_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Sends the initial metadata value to the client.</p><p>This method need not be called by implementations if they have nometadata to add to what the gRPC runtime will transmit.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>initial_metadata</strong> (<em>grpc.aio._metadata.Metadata</em>) – The initial <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.set_code"><em class="property">abstract </em><code class="sig-name descname">set_code</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">code</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.set_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.set_code" title="Permalink to this definition">¶</a></dt><dd><p>Sets the value to be used as status code upon RPC completion.</p><p>This method need not be called by method implementations if they wishthe gRPC runtime to determine the status code of the RPC.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>code</strong> (<a class="reference internal" href="grpc.html#grpc.StatusCode" title="grpc.StatusCode"><em>grpc.StatusCode</em></a>) – A StatusCode object to be sent to the client.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.set_compression"><em class="property">abstract </em><code class="sig-name descname">set_compression</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">compression</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.set_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.set_compression" title="Permalink to this definition">¶</a></dt><dd><p>Set the compression algorithm to be used for the entire call.</p><p>This is an EXPERIMENTAL method.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>compression</strong> (<a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a>) – An element of grpc.compression, e.g.grpc.compression.Gzip.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.set_details"><em class="property">abstract </em><code class="sig-name descname">set_details</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">details</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.set_details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.set_details" title="Permalink to this definition">¶</a></dt><dd><p>Sets the value to be used the as detail string upon RPC completion.</p><p>This method need not be called by method implementations if they haveno details to transmit.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>details</strong> (<em>str</em>) – A UTF-8-encodable string to be sent to the client upontermination of the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.set_trailing_metadata"><em class="property">abstract async </em><code class="sig-name descname">set_trailing_metadata</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">trailing_metadata</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.set_trailing_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.set_trailing_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Sends the trailing metadata for the RPC.</p><p>This method need not be called by implementations if they have nometadata to add to what the gRPC runtime will transmit.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><p><strong>trailing_metadata</strong> (<em>grpc.aio._metadata.Metadata</em>) – The trailing <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a>.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>None</p></dd></dl></dd></dl><dl class="py method"><dt id="grpc.experimental.aio.ServicerContext.write"><em class="property">abstract async </em><code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">message</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ServicerContext.write" title="Permalink to this definition">¶</a></dt><dd><p>Writes one message to the RPC.</p><p>Only one write operation is allowed simultaneously.</p><dl class="field-list simple"><dt class="field-odd">Raises</dt><dd class="field-odd"><p><strong>An RpcError exception if the write failed.</strong> – </p></dd><dt class="field-even">Parameters</dt><dd class="field-even"><p><strong>message</strong> (<em>ResponseType</em>) – </p></dd><dt class="field-odd">Return type</dt><dd class="field-odd"><p>None</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="client-side-interceptor"><h3>Client-Side Interceptor<a class="headerlink" href="#client-side-interceptor" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.ClientCallDetails"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">ClientCallDetails</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">timeout</span></em>, <em class="sig-param"><span class="n">metadata</span></em>, <em class="sig-param"><span class="n">credentials</span></em>, <em class="sig-param"><span class="n">wait_for_ready</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#ClientCallDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.ClientCallDetails" title="Permalink to this definition">¶</a></dt><dd><p>Describes an RPC to be invoked.</p><p>This is an EXPERIMENTAL API.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>method</strong> – The method name of the RPC.</p></li><li><p><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</p></li><li><p><strong>metadata</strong> – Optional metadata to be transmitted to the service-side ofthe RPC.</p></li><li><p><strong>credentials</strong> – An optional CallCredentials for the RPC.</p></li><li><p><strong>wait_for_ready</strong> – This is an EXPERIMENTAL argument. An optionalflag to enable <a class="reference internal" href="glossary.html#term-wait_for_ready"><span class="xref std std-term">wait_for_ready</span></a> mechanism.</p></li></ul></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.InterceptedUnaryUnaryCall"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">InterceptedUnaryUnaryCall</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwds</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#InterceptedUnaryUnaryCall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.InterceptedUnaryUnaryCall" title="Permalink to this definition">¶</a></dt><dd><p>Used for running a <cite>UnaryUnaryCall</cite> wrapped by interceptors.</p><p>For the <cite>__await__</cite> method is it is proxied to the intercepted call only whenthe interceptor task is finished.</p><dl class="py method"><dt id="grpc.experimental.aio.InterceptedUnaryUnaryCall.time_remaining"><code class="sig-name descname">time_remaining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#InterceptedUnaryUnaryCall.time_remaining"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.InterceptedUnaryUnaryCall.time_remaining" title="Permalink to this definition">¶</a></dt><dd><p>Describes the length of allowed time remaining for the RPC.</p><dl class="field-list simple"><dt class="field-odd">Returns</dt><dd class="field-odd"><p>A nonnegative float indicating the length of allowed time in secondsremaining for the RPC to complete before it is considered to havetimed out, or None if no deadline was specified for the RPC.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Optional[float]</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.UnaryUnaryClientInterceptor"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UnaryUnaryClientInterceptor</code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#UnaryUnaryClientInterceptor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryClientInterceptor" title="Permalink to this definition">¶</a></dt><dd><p>Affords intercepting unary-unary invocations.</p><dl class="py method"><dt id="grpc.experimental.aio.UnaryUnaryClientInterceptor.intercept_unary_unary"><em class="property">abstract async </em><code class="sig-name descname">intercept_unary_unary</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">continuation</span></em>, <em class="sig-param"><span class="n">client_call_details</span></em>, <em class="sig-param"><span class="n">request</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#UnaryUnaryClientInterceptor.intercept_unary_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryClientInterceptor.intercept_unary_unary" title="Permalink to this definition">¶</a></dt><dd><p>Intercepts a unary-unary invocation asynchronously.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>continuation</strong> (<em>Callable</em><em>[</em><em>[</em><em>grpc.aio._interceptor.ClientCallDetails</em><em>, </em><em>RequestType</em><em>]</em><em>, </em><em>grpc.aio._call.UnaryUnaryCall</em><em>]</em>) – A coroutine that proceeds with the invocation byexecuting the next interceptor in the chain or invoking theactual RPC on the underlying Channel. It is the interceptor’sresponsibility to call it if it decides to move the RPC forward.The interceptor can use<cite>call = await continuation(client_call_details, request)</cite>to continue with the RPC. <cite>continuation</cite> returns the call to theRPC.</p></li><li><p><strong>client_call_details</strong> (<em>grpc.aio._interceptor.ClientCallDetails</em>) – A ClientCallDetails object describing theoutgoing RPC.</p></li><li><p><strong>request</strong> (<em>RequestType</em>) – The request value for the RPC.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>An object with the RPC response.</p></dd><dt class="field-odd">Raises</dt><dd class="field-odd"><ul class="simple"><li><p><a class="reference internal" href="#grpc.experimental.aio.AioRpcError" title="grpc.experimental.aio.AioRpcError"><strong>AioRpcError</strong></a> – Indicating that the RPC terminated with non-OK status.</p></li><li><p><strong>asyncio.CancelledError</strong> – Indicating that the RPC was canceled.</p></li></ul></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>Union[grpc.aio._call.UnaryUnaryCall, ResponseType]</p></dd></dl></dd></dl></dd></dl></div><div class="section" id="multi-callable-interfaces"><h3>Multi-Callable Interfaces<a class="headerlink" href="#multi-callable-interfaces" title="Permalink to this headline">¶</a></h3><dl class="py class"><dt id="grpc.experimental.aio.UnaryUnaryMultiCallable"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UnaryUnaryMultiCallable</code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryUnaryMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Enables asynchronous invocation of a unary-call RPC.</p><dl class="py method"><dt id="grpc.experimental.aio.UnaryUnaryMultiCallable.__call__"><em class="property">abstract </em><code class="sig-name descname">__call__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request</span></em>, <em class="sig-param"><span class="o">*</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">metadata</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">credentials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">wait_for_ready</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryUnaryMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryUnaryMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>request</strong> (<em>Any</em>) – The request value for the RPC.</p></li><li><p><strong>timeout</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – An optional duration of time in seconds to allowfor the RPC.</p></li><li><p><strong>metadata</strong> (<em>Optional</em><em>[</em><em>grpc.aio._metadata.Metadata</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</p></li><li><p><strong>credentials</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.CallCredentials" title="grpc.CallCredentials"><em>grpc.CallCredentials</em></a><em>]</em>) – An optional CallCredentials for the RPC. Only valid forsecure Channel.</p></li><li><p><strong>wait_for_ready</strong> (<em>Optional</em><em>[</em><em>bool</em><em>]</em>) – This is an EXPERIMENTAL argument. An optionalflag to enable <a class="reference internal" href="glossary.html#term-wait_for_ready"><span class="xref std std-term">wait_for_ready</span></a> mechanism.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An element of grpc.compression, e.g.grpc.compression.Gzip. This is an EXPERIMENTAL option.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A UnaryUnaryCall object.</p></dd><dt class="field-odd">Raises</dt><dd class="field-odd"><p><a class="reference internal" href="grpc.html#grpc.RpcError" title="grpc.RpcError"><strong>RpcError</strong></a> – Indicates that the RPC terminated with non-OK status. The    raised RpcError will also be a Call for the RPC affording the RPC’s    metadata, status code, and details.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._base_call.UnaryUnaryCall</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.UnaryStreamMultiCallable"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">UnaryStreamMultiCallable</code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryStreamMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryStreamMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Enables asynchronous invocation of a server-streaming RPC.</p><dl class="py method"><dt id="grpc.experimental.aio.UnaryStreamMultiCallable.__call__"><em class="property">abstract </em><code class="sig-name descname">__call__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request</span></em>, <em class="sig-param"><span class="o">*</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">metadata</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">credentials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">wait_for_ready</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryStreamMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.UnaryStreamMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>request</strong> (<em>Any</em>) – The request value for the RPC.</p></li><li><p><strong>timeout</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – An optional duration of time in seconds to allowfor the RPC.</p></li><li><p><strong>metadata</strong> (<em>Optional</em><em>[</em><em>grpc.aio._metadata.Metadata</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</p></li><li><p><strong>credentials</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.CallCredentials" title="grpc.CallCredentials"><em>grpc.CallCredentials</em></a><em>]</em>) – An optional CallCredentials for the RPC. Only valid forsecure Channel.</p></li><li><p><strong>wait_for_ready</strong> (<em>Optional</em><em>[</em><em>bool</em><em>]</em>) – This is an EXPERIMENTAL argument. An optionalflag to enable <a class="reference internal" href="glossary.html#term-wait_for_ready"><span class="xref std std-term">wait_for_ready</span></a> mechanism.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An element of grpc.compression, e.g.grpc.compression.Gzip. This is an EXPERIMENTAL option.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A UnaryStreamCall object.</p></dd><dt class="field-odd">Raises</dt><dd class="field-odd"><p><a class="reference internal" href="grpc.html#grpc.RpcError" title="grpc.RpcError"><strong>RpcError</strong></a> – Indicates that the RPC terminated with non-OK status. The    raised RpcError will also be a Call for the RPC affording the RPC’s    metadata, status code, and details.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._base_call.UnaryStreamCall</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.StreamUnaryMultiCallable"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">StreamUnaryMultiCallable</code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamUnaryMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Enables asynchronous invocation of a client-streaming RPC.</p><dl class="py method"><dt id="grpc.experimental.aio.StreamUnaryMultiCallable.__call__"><em class="property">abstract </em><code class="sig-name descname">__call__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request_iterator</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">metadata</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">credentials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">wait_for_ready</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamUnaryMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamUnaryMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>request_iterator</strong> (<em>Optional</em><em>[</em><em>Union</em><em>[</em><em>Iterable</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>AsyncIterable</em><em>[</em><em>Any</em><em>]</em><em>]</em><em>]</em>) – An optional async iterable or iterable of requestmessages for the RPC.</p></li><li><p><strong>timeout</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – An optional duration of time in seconds to allowfor the RPC.</p></li><li><p><strong>metadata</strong> (<em>Optional</em><em>[</em><em>grpc.aio._metadata.Metadata</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</p></li><li><p><strong>credentials</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.CallCredentials" title="grpc.CallCredentials"><em>grpc.CallCredentials</em></a><em>]</em>) – An optional CallCredentials for the RPC. Only valid forsecure Channel.</p></li><li><p><strong>wait_for_ready</strong> (<em>Optional</em><em>[</em><em>bool</em><em>]</em>) – This is an EXPERIMENTAL argument. An optionalflag to enable <a class="reference internal" href="glossary.html#term-wait_for_ready"><span class="xref std std-term">wait_for_ready</span></a> mechanism.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An element of grpc.compression, e.g.grpc.compression.Gzip. This is an EXPERIMENTAL option.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A StreamUnaryCall object.</p></dd><dt class="field-odd">Raises</dt><dd class="field-odd"><p><a class="reference internal" href="grpc.html#grpc.RpcError" title="grpc.RpcError"><strong>RpcError</strong></a> – Indicates that the RPC terminated with non-OK status. The    raised RpcError will also be a Call for the RPC affording the RPC’s    metadata, status code, and details.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._base_call.StreamUnaryCall</p></dd></dl></dd></dl></dd></dl><dl class="py class"><dt id="grpc.experimental.aio.StreamStreamMultiCallable"><em class="property">class </em><code class="sig-prename descclassname">grpc.experimental.aio.</code><code class="sig-name descname">StreamStreamMultiCallable</code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamStreamMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Enables asynchronous invocation of a bidirectional-streaming RPC.</p><dl class="py method"><dt id="grpc.experimental.aio.StreamStreamMultiCallable.__call__"><em class="property">abstract </em><code class="sig-name descname">__call__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">request_iterator</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">metadata</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">credentials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">wait_for_ready</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">compression</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamStreamMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.experimental.aio.StreamStreamMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><dl class="field-list simple"><dt class="field-odd">Parameters</dt><dd class="field-odd"><ul class="simple"><li><p><strong>request_iterator</strong> (<em>Optional</em><em>[</em><em>Union</em><em>[</em><em>Iterable</em><em>[</em><em>Any</em><em>]</em><em>, </em><em>AsyncIterable</em><em>[</em><em>Any</em><em>]</em><em>]</em><em>]</em>) – An optional async iterable or iterable of requestmessages for the RPC.</p></li><li><p><strong>timeout</strong> (<em>Optional</em><em>[</em><em>float</em><em>]</em>) – An optional duration of time in seconds to allowfor the RPC.</p></li><li><p><strong>metadata</strong> (<em>Optional</em><em>[</em><em>grpc.aio._metadata.Metadata</em><em>]</em>) – Optional <a class="reference internal" href="glossary.html#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</p></li><li><p><strong>credentials</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.CallCredentials" title="grpc.CallCredentials"><em>grpc.CallCredentials</em></a><em>]</em>) – An optional CallCredentials for the RPC. Only valid forsecure Channel.</p></li><li><p><strong>wait_for_ready</strong> (<em>Optional</em><em>[</em><em>bool</em><em>]</em>) – This is an EXPERIMENTAL argument. An optionalflag to enable <a class="reference internal" href="glossary.html#term-wait_for_ready"><span class="xref std std-term">wait_for_ready</span></a> mechanism.</p></li><li><p><strong>compression</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="grpc.html#grpc.Compression" title="grpc.Compression"><em>grpc.Compression</em></a><em>]</em>) – An element of grpc.compression, e.g.grpc.compression.Gzip. This is an EXPERIMENTAL option.</p></li></ul></dd><dt class="field-even">Returns</dt><dd class="field-even"><p>A StreamStreamCall object.</p></dd><dt class="field-odd">Raises</dt><dd class="field-odd"><p><a class="reference internal" href="grpc.html#grpc.RpcError" title="grpc.RpcError"><strong>RpcError</strong></a> – Indicates that the RPC terminated with non-OK status. The    raised RpcError will also be a Call for the RPC affording the RPC’s    metadata, status code, and details.</p></dd><dt class="field-even">Return type</dt><dd class="field-even"><p>grpc.aio._base_call.StreamStreamCall</p></dd></dl></dd></dl></dd></dl></div></div></div>          </div>                  </div>      </div>    <div class="clearer"></div>  </div>    <div class="footer">      ©2020, The gRPC Authors.            |      <a href="_sources/grpc_asyncio.rst.txt"          rel="nofollow">Page source</a>    </div>            <script type="text/javascript">      var _gaq = _gaq || [];      _gaq.push(['_setAccount', 'UA-60127042-1']);      _gaq.push(['_setDomainName', 'none']);      _gaq.push(['_setAllowLinker', true]);      _gaq.push(['_trackPageview']);      (function() {        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);      })();    </script>      </body></html>
 |