1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741 |
- <!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.36.1 documentation</title>
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="stylesheet" href="_static/alabaster.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>
- <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.36.1</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="#server-side-interceptor">Server-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.aio">
- <span id="grpc-asyncio-api"></span><h1>gRPC AsyncIO API<a class="headerlink" href="#module-grpc.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 is
- tailored to AsyncIO. Underlying, it utilizes the same C-extension, gRPC C-Core,
- as existing stack, and it replaces all gRPC IO operations with methods provided
- by the AsyncIO library.</p>
- <p>This API is stable. Feel free to open issues on our GitHub repo
- <a class="reference external" href="https://github.com/grpc/grpc">grpc/grpc</a> for bugs or suggestions.</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 were
- created. 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 event
- loop 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 logic
- happens, for example, managing one or more underlying connections, name
- resolution, load balancing, flow control, etc.. If you are using ProtoBuf,
- Channel objects works best when further encapsulate into stub objects, then the
- application can invoke remote functions as if they are local functions.</p>
- <dl class="py function">
- <dt id="grpc.aio.insecure_channel">
- <code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">insecure_channel</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interceptors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_channel.html#insecure_channel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 be
- used 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 for
- any 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.aio.secure_channel">
- <code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">secure_channel</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interceptors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_channel.html#secure_channel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 be
- used 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 for
- any 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.aio.Channel">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">Channel</span></code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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. async
- with) type, although they are not supportted to be entered and exited
- multiple times.</p>
- <dl class="py method">
- <dt id="grpc.aio.Channel.__aenter__">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">__aenter__</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Channel.__aexit__">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">__aexit__</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">exc_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exc_tb</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.__aexit__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Channel.channel_ready">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">channel_ready</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Channel.close">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">close</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">grace</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#Channel.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 in
- all cases.</p>
- <p>If a grace period is specified, this method wait until all active
- RPCs are finshed, once the grace period is reached the ones that haven’t
- been 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.aio.Channel.get_state">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">get_state</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">try_to_connect</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 guaranteed
- that the return value of this function will eventually converge to that
- state.</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 to
- connect 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.aio.Channel.stream_stream">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">stream_stream</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_serializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response_deserializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- message. 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 the
- response message. Response goes undeserialized in case None
- is 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.aio.Channel.stream_unary">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">stream_unary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_serializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response_deserializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- message. 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 the
- response message. Response goes undeserialized in case None
- is 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.aio.Channel.unary_stream">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">unary_stream</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_serializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response_deserializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- message. 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 the
- response message. Response goes undeserialized in case None
- is 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.aio.Channel.unary_unary">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">unary_unary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_serializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response_deserializer</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- message. 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 the
- response message. Response goes undeserialized in case None
- is 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.aio.Channel.wait_for_state_change">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">wait_for_state_change</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">last_observed_state</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 connectivity
- state from the “last_observed_state”. If the state is already
- different, 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 can
- change arbitrary many times during the race, so there is no way to
- observe 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 representing
- the 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.aio.server">
- <code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">server</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">migration_thread_pool</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handlers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interceptors</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maximum_concurrent_rpcs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_server.html#server"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 the
- Server 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 time
- before 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 observe
- and optionally manipulate the incoming RPCs before handing them over to
- handlers. The interceptors are given control in the order they are
- specified. 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 server
- will service before returning RESOURCE_EXHAUSTED status, or None to
- indicate 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 the
- lifetime of the server unless overridden by set_compression. This is an
- EXPERIMENTAL 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.aio.Server">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">Server</span></code><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.Server" title="Permalink to this definition">¶</a></dt>
- <dd><p>Serves RPCs.</p>
- <dl class="py method">
- <dt id="grpc.aio.Server.add_generic_rpc_handlers">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_generic_rpc_handlers</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">generic_rpc_handlers</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Server.add_insecure_port">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_insecure_port</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">address</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Server.add_secure_port">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_secure_port</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">address</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">server_credentials</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 gRPC
- runtime 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.aio.Server.start">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">start</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Server.stop">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">stop</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">grace</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#Server.stop"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 in
- all cases.</p>
- <p>If a grace period is specified, this method returns immediately and all
- RPCs active at the end of the grace period are aborted. If a grace
- period is not specified (by passing None for grace), all existing RPCs
- are aborted immediately and this method blocks until the last RPC
- handler terminates.</p>
- <p>This method is idempotent and may be called at any time. Passing a
- smaller grace value in a subsequent call will have the effect of
- stopping the Server sooner (passing None will have the effect of
- stopping the server immediately). Passing a larger grace value in a
- subsequent 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.aio.Server.wait_for_termination">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">wait_for_termination</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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, and
- it 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 the
- operation 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.aio.BaseError">
- <em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">BaseError</span></code><a class="headerlink" href="#grpc.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.aio.UsageError">
- <em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UsageError</span></code><a class="headerlink" href="#grpc.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 styles
- of streaming API on the client side. This exception should not be
- suppressed.</p>
- </dd></dl>
- <dl class="py exception">
- <dt id="grpc.aio.AbortError">
- <em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">AbortError</span></code><a class="headerlink" href="#grpc.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 to
- perform certain clean-up logic, and then re-raise it.</p>
- </dd></dl>
- <dl class="py exception">
- <dt id="grpc.aio.InternalError">
- <em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">InternalError</span></code><a class="headerlink" href="#grpc.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.aio.AioRpcError">
- <em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">AioRpcError</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_metadata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">trailing_metadata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">details</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug_error_string</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_call.html#AioRpcError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 are
- determined. 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.aio.AioRpcError.code">
- <code class="sig-name descname"><span class="pre">code</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.AioRpcError.debug_error_string">
- <code class="sig-name descname"><span class="pre">debug_error_string</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.AioRpcError.details">
- <code class="sig-name descname"><span class="pre">details</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.AioRpcError.initial_metadata">
- <code class="sig-name descname"><span class="pre">initial_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.AioRpcError.trailing_metadata">
- <code class="sig-name descname"><span class="pre">trailing_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">RpcContext</span></code><a class="reference internal" href="_modules/grpc/aio/_base_call.html#RpcContext"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext.add_done_callback">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">add_done_callback</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">callback</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext.cancel">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">cancel</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext.cancelled">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">cancelled</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext.done">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">done</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.RpcContext.time_remaining">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">time_remaining</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 seconds
- remaining for the RPC to complete before it is considered to have
- timed 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.aio.Call">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">Call</span></code><a class="reference internal" href="_modules/grpc/aio/_base_call.html#Call"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Call.code">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">code</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Call.details">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">details</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Call.initial_metadata">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">initial_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Call.trailing_metadata">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">trailing_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.Call.wait_for_connection">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">wait_for_connection</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 connection
- failure.</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.aio.UnaryUnaryCall">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryUnaryCall</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwds</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryUnaryCall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.UnaryUnaryCall.__await__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__await__</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.UnaryStreamCall">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryStreamCall</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwds</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#UnaryStreamCall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.UnaryStreamCall" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="py method">
- <dt id="grpc.aio.UnaryStreamCall.__aiter__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__aiter__</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.UnaryStreamCall.read">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">read</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 multiple
- coroutines.</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 the
- stream.</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.aio.StreamUnaryCall">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamUnaryCall</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwds</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamUnaryCall" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="py method">
- <dt id="grpc.aio.StreamUnaryCall.__await__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__await__</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.StreamUnaryCall.done_writing">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">done_writing</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 write
- function 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.aio.StreamUnaryCall.write">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">write</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamUnaryCall.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.StreamStreamCall">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamStreamCall</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwds</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamStreamCall" title="Permalink to this definition">¶</a></dt>
- <dd><dl class="py method">
- <dt id="grpc.aio.StreamStreamCall.__aiter__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__aiter__</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.StreamStreamCall.done_writing">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">done_writing</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 write
- function 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.aio.StreamStreamCall.read">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">read</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 multiple
- coroutines.</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 the
- stream.</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.aio.StreamStreamCall.write">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">write</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_call.html#StreamStreamCall.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">ServicerContext</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwds</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.abort">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">abort</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">details</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">trailing_metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">()</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.abort"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 existing
- ones.</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 upon
- termination 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.aio.ServicerContext.auth_context">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">auth_context</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.disable_next_message_compression">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">disable_next_message_compression</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 during
- server 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.aio.ServicerContext.invocation_metadata">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">invocation_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.peer">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">peer</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.peer_identities">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">peer_identities</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.ServicerContext.peer_identities" title="Permalink to this definition">¶</a></dt>
- <dd><p>Gets one or more peer identity(s).</p>
- <p>Equivalent to
- servicer_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 not
- authenticated. 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.aio.ServicerContext.peer_identity_key">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">peer_identity_key</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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” are
- used 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 the
- peer 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.aio.ServicerContext.read">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">read</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.send_initial_metadata">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">send_initial_metadata</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">initial_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 no
- metadata 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.aio.ServicerContext.set_code">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">set_code</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 wish
- the 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.aio.ServicerContext.set_compression">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">set_compression</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">compression</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ServicerContext.set_details">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">set_details</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">details</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 have
- no 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 upon
- termination 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.aio.ServicerContext.set_trailing_metadata">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">set_trailing_metadata</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">trailing_metadata</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 no
- metadata 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.aio.ServicerContext.write">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">write</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_server.html#ServicerContext.write"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.ClientCallDetails">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">ClientCallDetails</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#ClientCallDetails"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 of
- the 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 optional
- flag 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.aio.InterceptedUnaryUnaryCall">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">InterceptedUnaryUnaryCall</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">interceptors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">channel</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_serializer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response_deserializer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">loop</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#InterceptedUnaryUnaryCall"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 when
- the interceptor task is finished.</p>
- <dl class="py method">
- <dt id="grpc.aio.InterceptedUnaryUnaryCall.time_remaining">
- <code class="sig-name descname"><span class="pre">time_remaining</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 seconds
- remaining for the RPC to complete before it is considered to have
- timed 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.aio.ClientInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">ClientInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#ClientInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.ClientInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Base class used for all Aio Client Interceptor classes</p>
- </dd></dl>
- <dl class="py class">
- <dt id="grpc.aio.UnaryUnaryClientInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryUnaryClientInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#UnaryUnaryClientInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.UnaryUnaryClientInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Affords intercepting unary-unary invocations.</p>
- <dl class="py method">
- <dt id="grpc.aio.UnaryUnaryClientInterceptor.intercept_unary_unary">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">intercept_unary_unary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">continuation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client_call_details</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></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"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor’s
- responsibility 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 the
- RPC.</p></li>
- <li><p><strong>client_call_details</strong> (<em>grpc.aio._interceptor.ClientCallDetails</em>) – A ClientCallDetails object describing the
- outgoing 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.aio.AioRpcError" title="grpc.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>
- <dl class="py class">
- <dt id="grpc.aio.UnaryStreamClientInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryStreamClientInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#UnaryStreamClientInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.UnaryStreamClientInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Affords intercepting unary-stream invocations.</p>
- <dl class="py method">
- <dt id="grpc.aio.UnaryStreamClientInterceptor.intercept_unary_stream">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">intercept_unary_stream</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">continuation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client_call_details</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#UnaryStreamClientInterceptor.intercept_unary_stream"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.UnaryStreamClientInterceptor.intercept_unary_stream" title="Permalink to this definition">¶</a></dt>
- <dd><p>Intercepts a unary-stream invocation asynchronously.</p>
- <p>The function could return the call object or an asynchronous
- iterator, in case of being an asyncrhonous iterator this will
- become the source of the reads done by the caller.</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.UnaryStreamCall</em><em>]</em>) – A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor’s
- responsibility 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 the
- RPC.</p></li>
- <li><p><strong>client_call_details</strong> (<em>grpc.aio._interceptor.ClientCallDetails</em>) – A ClientCallDetails object describing the
- outgoing 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>The RPC Call or an asynchronous iterator.</p>
- </dd>
- <dt class="field-odd">Raises</dt>
- <dd class="field-odd"><ul class="simple">
- <li><p><a class="reference internal" href="#grpc.aio.AioRpcError" title="grpc.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[AsyncIterable[Any], grpc.aio._call.UnaryStreamCall]</p>
- </dd>
- </dl>
- </dd></dl>
- </dd></dl>
- <dl class="py class">
- <dt id="grpc.aio.StreamUnaryClientInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamUnaryClientInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#StreamUnaryClientInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamUnaryClientInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Affords intercepting stream-unary invocations.</p>
- <dl class="py method">
- <dt id="grpc.aio.StreamUnaryClientInterceptor.intercept_stream_unary">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">intercept_stream_unary</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">continuation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client_call_details</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_iterator</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#StreamUnaryClientInterceptor.intercept_stream_unary"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamUnaryClientInterceptor.intercept_stream_unary" title="Permalink to this definition">¶</a></dt>
- <dd><p>Intercepts a stream-unary invocation asynchronously.</p>
- <p>Within the interceptor the usage of the call methods like <cite>write</cite> or
- even awaiting the call should be done carefully, since the caller
- could be expecting an untouched call, for example for start writing
- messages to it.</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.UnaryStreamCall</em><em>]</em>) – A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor’s
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- <cite>call = await continuation(client_call_details, request_iterator)</cite>
- to continue with the RPC. <cite>continuation</cite> returns the call to the
- RPC.</p></li>
- <li><p><strong>client_call_details</strong> (<em>grpc.aio._interceptor.ClientCallDetails</em>) – A ClientCallDetails object describing the
- outgoing RPC.</p></li>
- <li><p><strong>request_iterator</strong> (<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>) – The request iterator that will produce requests
- for the RPC.</p></li>
- </ul>
- </dd>
- <dt class="field-even">Returns</dt>
- <dd class="field-even"><p>The RPC Call.</p>
- </dd>
- <dt class="field-odd">Raises</dt>
- <dd class="field-odd"><ul class="simple">
- <li><p><a class="reference internal" href="#grpc.aio.AioRpcError" title="grpc.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>grpc.aio._call.StreamUnaryCall</p>
- </dd>
- </dl>
- </dd></dl>
- </dd></dl>
- <dl class="py class">
- <dt id="grpc.aio.StreamStreamClientInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamStreamClientInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#StreamStreamClientInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamStreamClientInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Affords intercepting stream-stream invocations.</p>
- <dl class="py method">
- <dt id="grpc.aio.StreamStreamClientInterceptor.intercept_stream_stream">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">intercept_stream_stream</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">continuation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">client_call_details</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request_iterator</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#StreamStreamClientInterceptor.intercept_stream_stream"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.StreamStreamClientInterceptor.intercept_stream_stream" title="Permalink to this definition">¶</a></dt>
- <dd><p>Intercepts a stream-stream invocation asynchronously.</p>
- <p>Within the interceptor the usage of the call methods like <cite>write</cite> or
- even awaiting the call should be done carefully, since the caller
- could be expecting an untouched call, for example for start writing
- messages to it.</p>
- <p>The function could return the call object or an asynchronous
- iterator, in case of being an asyncrhonous iterator this will
- become the source of the reads done by the caller.</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.UnaryStreamCall</em><em>]</em>) – A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor’s
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- <cite>call = await continuation(client_call_details, request_iterator)</cite>
- to continue with the RPC. <cite>continuation</cite> returns the call to the
- RPC.</p></li>
- <li><p><strong>client_call_details</strong> (<em>grpc.aio._interceptor.ClientCallDetails</em>) – A ClientCallDetails object describing the
- outgoing RPC.</p></li>
- <li><p><strong>request_iterator</strong> (<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>) – The request iterator that will produce requests
- for the RPC.</p></li>
- </ul>
- </dd>
- <dt class="field-even">Returns</dt>
- <dd class="field-even"><p>The RPC Call or an asynchronous iterator.</p>
- </dd>
- <dt class="field-odd">Raises</dt>
- <dd class="field-odd"><ul class="simple">
- <li><p><a class="reference internal" href="#grpc.aio.AioRpcError" title="grpc.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[AsyncIterable[Any], grpc.aio._call.StreamStreamCall]</p>
- </dd>
- </dl>
- </dd></dl>
- </dd></dl>
- </div>
- <div class="section" id="server-side-interceptor">
- <h3>Server-Side Interceptor<a class="headerlink" href="#server-side-interceptor" title="Permalink to this headline">¶</a></h3>
- <dl class="py class">
- <dt id="grpc.aio.ServerInterceptor">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">ServerInterceptor</span></code><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#ServerInterceptor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.ServerInterceptor" title="Permalink to this definition">¶</a></dt>
- <dd><p>Affords intercepting incoming RPCs on the service-side.</p>
- <p>This is an EXPERIMENTAL API.</p>
- <dl class="py method">
- <dt id="grpc.aio.ServerInterceptor.intercept_service">
- <em class="property"><span class="pre">abstract</span> <span class="pre">async</span> </em><code class="sig-name descname"><span class="pre">intercept_service</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">continuation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handler_call_details</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_interceptor.html#ServerInterceptor.intercept_service"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.aio.ServerInterceptor.intercept_service" title="Permalink to this definition">¶</a></dt>
- <dd><p>Intercepts incoming RPCs before handing them over to a handler.</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><a class="reference internal" href="grpc.html#grpc.HandlerCallDetails" title="grpc.HandlerCallDetails"><em>grpc.HandlerCallDetails</em></a><em>]</em><em>, </em><em>Awaitable</em><em>[</em><a class="reference internal" href="grpc.html#grpc.RpcMethodHandler" title="grpc.RpcMethodHandler"><em>grpc.RpcMethodHandler</em></a><em>]</em><em>]</em>) – A function that takes a HandlerCallDetails and
- proceeds to invoke the next interceptor in the chain, if any,
- or the RPC handler lookup logic, with the call details passed
- as an argument, and returns an RpcMethodHandler instance if
- the RPC is considered serviced, or None otherwise.</p></li>
- <li><p><strong>handler_call_details</strong> (<a class="reference internal" href="grpc.html#grpc.HandlerCallDetails" title="grpc.HandlerCallDetails"><em>grpc.HandlerCallDetails</em></a>) – A HandlerCallDetails describing the RPC.</p></li>
- </ul>
- </dd>
- <dt class="field-even">Returns</dt>
- <dd class="field-even"><p>An RpcMethodHandler with which the RPC may be serviced if the
- interceptor chooses to service this RPC, or None otherwise.</p>
- </dd>
- <dt class="field-odd">Return type</dt>
- <dd class="field-odd"><p><a class="reference internal" href="grpc.html#grpc.RpcMethodHandler" title="grpc.RpcMethodHandler">grpc.RpcMethodHandler</a></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.aio.UnaryUnaryMultiCallable">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryUnaryMultiCallable</span></code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryUnaryMultiCallable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.UnaryUnaryMultiCallable.__call__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__call__</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryUnaryMultiCallable.__call__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 allow
- for 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 the
- service-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 for
- secure 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 optional
- flag 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.aio.UnaryStreamMultiCallable">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">UnaryStreamMultiCallable</span></code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryStreamMultiCallable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.UnaryStreamMultiCallable.__call__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__call__</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#UnaryStreamMultiCallable.__call__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 allow
- for 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 the
- service-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 for
- secure 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 optional
- flag 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.aio.StreamUnaryMultiCallable">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamUnaryMultiCallable</span></code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamUnaryMultiCallable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.StreamUnaryMultiCallable.__call__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__call__</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request_iterator</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamUnaryMultiCallable.__call__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- messages 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 allow
- for 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 the
- service-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 for
- secure 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 optional
- flag 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.aio.StreamStreamMultiCallable">
- <em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">grpc.aio.</span></code><code class="sig-name descname"><span class="pre">StreamStreamMultiCallable</span></code><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamStreamMultiCallable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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.aio.StreamStreamMultiCallable.__call__">
- <em class="property"><span class="pre">abstract</span> </em><code class="sig-name descname"><span class="pre">__call__</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request_iterator</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">credentials</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_for_ready</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">compression</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/aio/_base_channel.html#StreamStreamMultiCallable.__call__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc.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 request
- messages 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 allow
- for 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 the
- service-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 for
- secure 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 optional
- flag 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>
|