| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917 | 
<!DOCTYPE html><!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--><!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--><head>  <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <title>grpc package — grpcio 1.0.4 documentation</title>                          <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />              <link rel="index" title="Index"              href="genindex.html"/>        <link rel="search" title="Search" href="search.html"/>    <link rel="top" title="grpcio 1.0.4 documentation" href="index.html"/>        <link rel="next" title="grpc.beta package" href="grpc.beta.html"/>        <link rel="prev" title="Welcome to grpcio’s documentation!" href="index.html"/>     <script src="_static/js/modernizr.min.js"></script></head><body class="wy-body-for-nav" role="document">     <div class="wy-grid-for-nav">        <nav data-toggle="wy-nav-shift" class="wy-nav-side">      <div class="wy-side-scroll">        <div class="wy-side-nav-search">                                <a href="index.html" class="icon icon-home"> grpcio                              </a>                                                <div class="version">                1.0.4              </div>                                <div role="search">  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">    <input type="text" name="q" placeholder="Search docs" />    <input type="hidden" name="check_keywords" value="yes" />    <input type="hidden" name="area" value="default" />  </form></div>                  </div>        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">                                                  <p class="caption"><span class="caption-text">Contents:</span></p><ul class="current"><li class="toctree-l1 current"><a class="current reference internal" href="#">grpc package</a><ul><li class="toctree-l2"><a class="reference internal" href="#subpackages">Subpackages</a><ul><li class="toctree-l3"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a></li><li class="toctree-l3"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a></li></ul></li><li class="toctree-l2"><a class="reference internal" href="#module-grpc">Module contents</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="#glossary">Glossary</a></li></ul>                              </div>      </div>    </nav>    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">            <nav class="wy-nav-top" role="navigation" aria-label="top navigation">        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>        <a href="index.html">grpcio</a>      </nav>            <div class="wy-nav-content">        <div class="rst-content">           <div role="navigation" aria-label="breadcrumbs navigation">  <ul class="wy-breadcrumbs">    <li><a href="index.html">Docs</a> »</li>          <li>grpc package</li>    <li class="wy-breadcrumbs-aside">                          <a href="_sources/grpc.rst.txt" rel="nofollow"> View page source</a>                  </li>  </ul>  <hr/></div>          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">           <div itemprop="articleBody">              <div class="section" id="grpc-package"><h1>grpc package<a class="headerlink" href="#grpc-package" title="Permalink to this headline">¶</a></h1><div class="section" id="subpackages"><h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2><div class="toctree-wrapper compound"><ul><li class="toctree-l1"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a><ul><li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#submodules">Submodules</a></li><li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.implementations">grpc.beta.implementations module</a></li><li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.interfaces">grpc.beta.interfaces module</a></li><li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.utilities">grpc.beta.utilities module</a></li><li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta">Module contents</a></li></ul></li><li class="toctree-l1"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a><ul><li class="toctree-l2"><a class="reference internal" href="grpc.framework.html#subpackages">Subpackages</a><ul><li class="toctree-l3"><a class="reference internal" href="grpc.framework.common.html">grpc.framework.common package</a><ul><li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#submodules">Submodules</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#module-grpc.framework.common.cardinality">grpc.framework.common.cardinality module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#module-grpc.framework.common.style">grpc.framework.common.style module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#module-grpc.framework.common">Module contents</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="grpc.framework.foundation.html">grpc.framework.foundation package</a><ul><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#submodules">Submodules</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.abandonment">grpc.framework.foundation.abandonment module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.callable_util">grpc.framework.foundation.callable_util module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.future">grpc.framework.foundation.future module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.logging_pool">grpc.framework.foundation.logging_pool module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.stream">grpc.framework.foundation.stream module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation.stream_util">grpc.framework.foundation.stream_util module</a></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation">Module contents</a></li></ul></li><li class="toctree-l3"><a class="reference internal" href="grpc.framework.interfaces.html">grpc.framework.interfaces package</a><ul><li class="toctree-l4"><a class="reference internal" href="grpc.framework.interfaces.html#subpackages">Subpackages</a><ul><li class="toctree-l5"><a class="reference internal" href="grpc.framework.interfaces.base.html">grpc.framework.interfaces.base package</a><ul><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#submodules">Submodules</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#module-grpc.framework.interfaces.base.base">grpc.framework.interfaces.base.base module</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#module-grpc.framework.interfaces.base.utilities">grpc.framework.interfaces.base.utilities module</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#module-grpc.framework.interfaces.base">Module contents</a></li></ul></li><li class="toctree-l5"><a class="reference internal" href="grpc.framework.interfaces.face.html">grpc.framework.interfaces.face package</a><ul><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#submodules">Submodules</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#module-grpc.framework.interfaces.face.face">grpc.framework.interfaces.face.face module</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#module-grpc.framework.interfaces.face.utilities">grpc.framework.interfaces.face.utilities module</a></li><li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#module-grpc.framework.interfaces.face">Module contents</a></li></ul></li></ul></li><li class="toctree-l4"><a class="reference internal" href="grpc.framework.interfaces.html#module-grpc.framework.interfaces">Module contents</a></li></ul></li></ul></li><li class="toctree-l2"><a class="reference internal" href="grpc.framework.html#module-grpc.framework">Module contents</a></li></ul></li></ul></div></div><div class="section" id="module-grpc"><span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc" title="Permalink to this headline">¶</a></h2><p>gRPC’s Python API.</p><dl class="exception"><dt id="grpc.FutureTimeoutError"><em class="property">exception </em><code class="descclassname">grpc.</code><code class="descname">FutureTimeoutError</code><a class="reference internal" href="_modules/grpc.html#FutureTimeoutError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.FutureTimeoutError" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></p><p>Indicates that a method call on a Future timed out.</p></dd></dl><dl class="exception"><dt id="grpc.FutureCancelledError"><em class="property">exception </em><code class="descclassname">grpc.</code><code class="descname">FutureCancelledError</code><a class="reference internal" href="_modules/grpc.html#FutureCancelledError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.FutureCancelledError" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></p><p>Indicates that the computation underlying a Future was cancelled.</p></dd></dl><dl class="class"><dt id="grpc.Future"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">Future</code><a class="reference internal" href="_modules/grpc.html#Future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A representation of a computation in another control flow.</p><p>Computations represented by a Future may be yet to be begun, may be ongoing,or may have already completed.</p><dl class="method"><dt id="grpc.Future.add_done_callback"><code class="descname">add_done_callback</code><span class="sig-paren">(</span><em>fn</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.add_done_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.add_done_callback" title="Permalink to this definition">¶</a></dt><dd><p>Adds a function to be called at completion of the computation.</p><p>The callback will be passed this Future object describing the outcome ofthe computation.</p><p>If the computation has already completed, the callback will be calledimmediately.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fn</strong> – A callable taking this Future object as its single parameter.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.cancel"><code class="descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.cancel" title="Permalink to this definition">¶</a></dt><dd><p>Attempts to cancel the computation.</p><p>This method does not block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>True if the computation has not yet begun, will not be allowed to take</dt><dd>place, and determination of both was possible without blocking. Falseunder all other circumstances including but not limited to thecomputation’s already having begun, the computation’s already havingfinished, and the computation’s having been scheduled for execution on aremote system for which a determination of whether or not it commencedbefore being cancelled cannot be made without blocking.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.cancelled"><code class="descname">cancelled</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.cancelled"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.cancelled" title="Permalink to this definition">¶</a></dt><dd><p>Describes whether the computation was cancelled.</p><p>This method does not block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>True if the computation was cancelled any time before its result became</dt><dd>immediately available. False under all other circumstances including butnot limited to this object’s cancel method not having been called andthe computation’s result having become immediately available.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.done"><code class="descname">done</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.done"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.done" title="Permalink to this definition">¶</a></dt><dd><p>Describes whether the computation has taken place.</p><p>This method does not block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>True if the computation is known to have either completed or have been</dt><dd>unscheduled or interrupted. False if the computation may possibly beexecuting or scheduled to execute later.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.exception"><code class="descname">exception</code><span class="sig-paren">(</span><em>timeout=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.exception"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.exception" title="Permalink to this definition">¶</a></dt><dd><p>Return the exception raised by the computation.</p><p>This method may return immediately or may block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> – The length of time in seconds to wait for the computation toterminate or be cancelled, or None if this method should block untilthe computation is terminated or is cancelled no matter how long thattakes.</p></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils"><dt>The exception raised by the computation, or None if the computation did</dt><dd><p class="first last">not raise an exception.</p></dd></dl></p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple"><li><a class="reference internal" href="#grpc.FutureTimeoutError" title="grpc.FutureTimeoutError"><code class="xref py py-exc docutils literal"><span class="pre">FutureTimeoutError</span></code></a> – If a timeout value is passed and the computation doesnot terminate within the allotted time.</li><li><a class="reference internal" href="#grpc.FutureCancelledError" title="grpc.FutureCancelledError"><code class="xref py py-exc docutils literal"><span class="pre">FutureCancelledError</span></code></a> – If the computation was cancelled.</li></ul></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.result"><code class="descname">result</code><span class="sig-paren">(</span><em>timeout=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.result"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.result" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the outcome of the computation or raises its exception.</p><p>This method may return immediately or may block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> – The length of time in seconds to wait for the computation tofinish or be cancelled, or None if this method should block until thecomputation has finished or is cancelled no matter how long that takes.</p></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The return value of the computation.</p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple"><li><a class="reference internal" href="#grpc.FutureTimeoutError" title="grpc.FutureTimeoutError"><code class="xref py py-exc docutils literal"><span class="pre">FutureTimeoutError</span></code></a> – If a timeout value is passed and the computation doesnot terminate within the allotted time.</li><li><a class="reference internal" href="#grpc.FutureCancelledError" title="grpc.FutureCancelledError"><code class="xref py py-exc docutils literal"><span class="pre">FutureCancelledError</span></code></a> – If the computation was cancelled.</li><li><code class="xref py py-exc docutils literal"><span class="pre">Exception</span></code> – If the computation raised an exception, this call will raisethe same exception.</li></ul></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.running"><code class="descname">running</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.running"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.running" title="Permalink to this definition">¶</a></dt><dd><p>Describes whether the computation is taking place.</p><p>This method does not block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>True if the computation is scheduled to take place in the future or is</dt><dd>taking place now, or False if the computation took place in the past orwas cancelled.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Future.traceback"><code class="descname">traceback</code><span class="sig-paren">(</span><em>timeout=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Future.traceback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Future.traceback" title="Permalink to this definition">¶</a></dt><dd><p>Access the traceback of the exception raised by the computation.</p><p>This method may return immediately or may block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> – The length of time in seconds to wait for the computation toterminate or be cancelled, or None if this method should block untilthe computation is terminated or is cancelled no matter how long thattakes.</p></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils"><dt>The traceback of the exception raised by the computation, or None if the</dt><dd><p class="first last">computation did not raise an exception.</p></dd></dl></p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple"><li><a class="reference internal" href="#grpc.FutureTimeoutError" title="grpc.FutureTimeoutError"><code class="xref py py-exc docutils literal"><span class="pre">FutureTimeoutError</span></code></a> – If a timeout value is passed and the computation doesnot terminate within the allotted time.</li><li><a class="reference internal" href="#grpc.FutureCancelledError" title="grpc.FutureCancelledError"><code class="xref py py-exc docutils literal"><span class="pre">FutureCancelledError</span></code></a> – If the computation was cancelled.</li></ul></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.ChannelConnectivity"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">ChannelConnectivity</code><a class="reference internal" href="_modules/grpc.html#ChannelConnectivity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ChannelConnectivity" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p><p>Mirrors grpc_connectivity_state in the gRPC Core.</p><dl class="attribute"><dt id="grpc.ChannelConnectivity.IDLE"><code class="descname">IDLE</code><a class="headerlink" href="#grpc.ChannelConnectivity.IDLE" title="Permalink to this definition">¶</a></dt><dd><p>The channel is idle.</p></dd></dl><dl class="attribute"><dt id="grpc.ChannelConnectivity.CONNECTING"><code class="descname">CONNECTING</code><a class="headerlink" href="#grpc.ChannelConnectivity.CONNECTING" title="Permalink to this definition">¶</a></dt><dd><p>The channel is connecting.</p></dd></dl><dl class="attribute"><dt id="grpc.ChannelConnectivity.READY"><code class="descname">READY</code><a class="headerlink" href="#grpc.ChannelConnectivity.READY" title="Permalink to this definition">¶</a></dt><dd><p>The channel is ready to conduct RPCs.</p></dd></dl><dl class="attribute"><dt id="grpc.ChannelConnectivity.TRANSIENT_FAILURE"><code class="descname">TRANSIENT_FAILURE</code><a class="headerlink" href="#grpc.ChannelConnectivity.TRANSIENT_FAILURE" title="Permalink to this definition">¶</a></dt><dd><p>The channel has seen a failure from which it expects torecover.</p></dd></dl><dl class="attribute"><dt id="grpc.ChannelConnectivity.SHUTDOWN"><code class="descname">SHUTDOWN</code><a class="headerlink" href="#grpc.ChannelConnectivity.SHUTDOWN" title="Permalink to this definition">¶</a></dt><dd><p>The channel has seen a failure from which it cannot recover.</p></dd></dl></dd></dl><dl class="class"><dt id="grpc.StatusCode"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">StatusCode</code><a class="reference internal" href="_modules/grpc.html#StatusCode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StatusCode" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p><p>Mirrors grpc_status_code in the gRPC Core.</p></dd></dl><dl class="exception"><dt id="grpc.RpcError"><em class="property">exception </em><code class="descclassname">grpc.</code><code class="descname">RpcError</code><a class="reference internal" href="_modules/grpc.html#RpcError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcError" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></p><p>Raised by the gRPC library to indicate non-OK-status RPC termination.</p></dd></dl><dl class="class"><dt id="grpc.RpcContext"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">RpcContext</code><a class="reference internal" href="_modules/grpc.html#RpcContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcContext" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Provides RPC-related information and action.</p><dl class="method"><dt id="grpc.RpcContext.add_callback"><code class="descname">add_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#RpcContext.add_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcContext.add_callback" title="Permalink to this definition">¶</a></dt><dd><p>Registers a callback to be called on RPC termination.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – A no-parameter callable to be called on RPC termination.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>True if the callback was added and will be called later; False if the</dt><dd>callback was not added and will not later be called (because the RPCalready terminated or some other reason).</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.RpcContext.cancel"><code class="descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#RpcContext.cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.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></dd></dl><dl class="method"><dt id="grpc.RpcContext.is_active"><code class="descname">is_active</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#RpcContext.is_active"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcContext.is_active" title="Permalink to this definition">¶</a></dt><dd><p>Describes whether the RPC is active or has terminated.</p></dd></dl><dl class="method"><dt id="grpc.RpcContext.time_remaining"><code class="descname">time_remaining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#RpcContext.time_remaining"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcContext.time_remaining" title="Permalink to this definition">¶</a></dt><dd><p>Describes the length of allowed time remaining for the RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A nonnegative float indicating the length of allowed time in secondsremaining for the RPC to complete before it is considered to have timedout, or None if no deadline was specified for the RPC.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.Call"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">Call</code><a class="reference internal" href="_modules/grpc.html#Call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Call" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <a class="reference internal" href="#grpc.RpcContext" title="grpc.RpcContext"><code class="xref py py-class docutils literal"><span class="pre">grpc.RpcContext</span></code></a></p><p>Invocation-side utility object for an RPC.</p><dl class="method"><dt id="grpc.Call.code"><code class="descname">code</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Call.code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Call.code" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the status code emitted by the service-side of the RPC.</p><p>This method blocks until the value is available.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The StatusCode value for the RPC.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Call.details"><code class="descname">details</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Call.details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Call.details" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the details value emitted by the service-side of the RPC.</p><p>This method blocks until the value is available.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The details string of the RPC.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Call.initial_metadata"><code class="descname">initial_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Call.initial_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Call.initial_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the initial metadata from the service-side of the RPC.</p><p>This method blocks until the value is available.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The initial <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Call.trailing_metadata"><code class="descname">trailing_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Call.trailing_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Call.trailing_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the trailing metadata from the service-side of the RPC.</p><p>This method blocks until the value is available.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The trailing <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.ChannelCredentials"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">ChannelCredentials</code><span class="sig-paren">(</span><em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ChannelCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ChannelCredentials" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating the data required to create a secure Channel.</p><p>This class has no supported interface - it exists to define the type of itsinstances and its instances exist to be passed to other functions.</p></dd></dl><dl class="class"><dt id="grpc.CallCredentials"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">CallCredentials</code><span class="sig-paren">(</span><em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#CallCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.CallCredentials" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating data asserting an identity over a channel.</p><p>A CallCredentials may be composed with ChannelCredentials to always assertidentity for every call over that Channel.</p><p>This class has no supported interface - it exists to define the type of itsinstances and its instances exist to be passed to other functions.</p></dd></dl><dl class="class"><dt id="grpc.AuthMetadataContext"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">AuthMetadataContext</code><a class="reference internal" href="_modules/grpc.html#AuthMetadataContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.AuthMetadataContext" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Provides information to call credentials metadata plugins.</p><dl class="attribute"><dt id="grpc.AuthMetadataContext.service_url"><code class="descname">service_url</code><a class="headerlink" href="#grpc.AuthMetadataContext.service_url" title="Permalink to this definition">¶</a></dt><dd><p>A string URL of the service being called into.</p></dd></dl><dl class="attribute"><dt id="grpc.AuthMetadataContext.method_name"><code class="descname">method_name</code><a class="headerlink" href="#grpc.AuthMetadataContext.method_name" title="Permalink to this definition">¶</a></dt><dd><p>A string of the fully qualified method name being called.</p></dd></dl></dd></dl><dl class="class"><dt id="grpc.AuthMetadataPluginCallback"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">AuthMetadataPluginCallback</code><a class="reference internal" href="_modules/grpc.html#AuthMetadataPluginCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.AuthMetadataPluginCallback" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Callback object received by a metadata plugin.</p><dl class="method"><dt id="grpc.AuthMetadataPluginCallback.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>metadata</em>, <em>error</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#AuthMetadataPluginCallback.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.AuthMetadataPluginCallback.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Inform the gRPC runtime of the metadata to construct a CallCredentials.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><strong>metadata</strong> – The <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> used to construct the CallCredentials.</li><li><strong>error</strong> – An Exception to indicate error or None to indicate success.</li></ul></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.AuthMetadataPlugin"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">AuthMetadataPlugin</code><a class="reference internal" href="_modules/grpc.html#AuthMetadataPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.AuthMetadataPlugin" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A specification for custom authentication.</p><dl class="method"><dt id="grpc.AuthMetadataPlugin.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>context</em>, <em>callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#AuthMetadataPlugin.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.AuthMetadataPlugin.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Implements authentication by passing metadata to a callback.</p><p>Implementations of this method must not block.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><strong>context</strong> – An AuthMetadataContext providing information on the RPC that theplugin is being called to authenticate.</li><li><strong>callback</strong> – An AuthMetadataPluginCallback to be invoked either synchronouslyor asynchronously.</li></ul></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.ServerCredentials"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">ServerCredentials</code><span class="sig-paren">(</span><em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServerCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServerCredentials" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>A value encapsulating the data required to open a secure port on a Server.</p><p>This class has no supported interface - it exists to define the type of itsinstances and its instances exist to be passed to other functions.</p></dd></dl><dl class="class"><dt id="grpc.UnaryUnaryMultiCallable"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">UnaryUnaryMultiCallable</code><a class="reference internal" href="_modules/grpc.html#UnaryUnaryMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryUnaryMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Affords invoking a unary-unary RPC.</p><dl class="method"><dt id="grpc.UnaryUnaryMultiCallable.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>request</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#UnaryUnaryMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryUnaryMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Synchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request</strong> – The request value for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The response value for the RPC.</p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#grpc.RpcError" title="grpc.RpcError"><code class="xref py py-exc docutils literal"><span class="pre">RpcError</span></code></a> – Indicating that the RPC terminated with non-OK status. Theraised RpcError will also be a Call for the RPC affording the RPC’smetadata, status code, and details.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.UnaryUnaryMultiCallable.future"><code class="descname">future</code><span class="sig-paren">(</span><em>request</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#UnaryUnaryMultiCallable.future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryUnaryMultiCallable.future" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request</strong> – The request value for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An object that is both a Call for the RPC and a Future. In the event of</dt><dd><p class="first last">RPC completion, the return Future’s result value will be the responsemessage of the RPC. Should the event terminate with non-OK status, thereturned Future’s exception value will be an RpcError.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.UnaryUnaryMultiCallable.with_call"><code class="descname">with_call</code><span class="sig-paren">(</span><em>request</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#UnaryUnaryMultiCallable.with_call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryUnaryMultiCallable.with_call" title="Permalink to this definition">¶</a></dt><dd><p>Synchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request</strong> – The request value for the RPC.</li><li><strong>timeout</strong> – An optional durating of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The response value for the RPC and a Call value for the RPC.</p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#grpc.RpcError" title="grpc.RpcError"><code class="xref py py-exc docutils literal"><span class="pre">RpcError</span></code></a> – Indicating that the RPC terminated with non-OK status. Theraised RpcError will also be a Call for the RPC affording the RPC’smetadata, status code, and details.</p></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.UnaryStreamMultiCallable"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">UnaryStreamMultiCallable</code><a class="reference internal" href="_modules/grpc.html#UnaryStreamMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryStreamMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Affords invoking a unary-stream RPC.</p><dl class="method"><dt id="grpc.UnaryStreamMultiCallable.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>request</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#UnaryStreamMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.UnaryStreamMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request</strong> – The request value for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – An optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An object that is both a Call for the RPC and an iterator of response</dt><dd><p class="first last">values. Drawing response values from the returned iterator may raiseRpcError indicating termination of the RPC with non-OK status.</p></dd></dl></p></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.StreamUnaryMultiCallable"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">StreamUnaryMultiCallable</code><a class="reference internal" href="_modules/grpc.html#StreamUnaryMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamUnaryMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Affords invoking a stream-unary RPC in any call style.</p><dl class="method"><dt id="grpc.StreamUnaryMultiCallable.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#StreamUnaryMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamUnaryMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Synchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request_iterator</strong> – An iterator that yields request values for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils"><dt>The response value for the RPC, and a Call for the RPC if with_call was</dt><dd><p class="first last">set to True at invocation.</p></dd></dl></p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#grpc.RpcError" title="grpc.RpcError"><code class="xref py py-exc docutils literal"><span class="pre">RpcError</span></code></a> – Indicating that the RPC terminated with non-OK status. Theraised RpcError will also be a Call for the RPC affording the RPC’smetadata, status code, and details.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.StreamUnaryMultiCallable.future"><code class="descname">future</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#StreamUnaryMultiCallable.future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamUnaryMultiCallable.future" title="Permalink to this definition">¶</a></dt><dd><p>Asynchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request_iterator</strong> – An iterator that yields request values for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An object that is both a Call for the RPC and a Future. In the event of</dt><dd><p class="first last">RPC completion, the return Future’s result value will be the responsemessage of the RPC. Should the event terminate with non-OK status, thereturned Future’s exception value will be an RpcError.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.StreamUnaryMultiCallable.with_call"><code class="descname">with_call</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#StreamUnaryMultiCallable.with_call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamUnaryMultiCallable.with_call" title="Permalink to this definition">¶</a></dt><dd><p>Synchronously invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request_iterator</strong> – An iterator that yields request values for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The response value for the RPC and a Call for the RPC.</p></td></tr><tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#grpc.RpcError" title="grpc.RpcError"><code class="xref py py-exc docutils literal"><span class="pre">RpcError</span></code></a> – Indicating that the RPC terminated with non-OK status. Theraised RpcError will also be a Call for the RPC affording the RPC’smetadata, status code, and details.</p></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.StreamStreamMultiCallable"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">StreamStreamMultiCallable</code><a class="reference internal" href="_modules/grpc.html#StreamStreamMultiCallable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamStreamMultiCallable" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Affords invoking a stream-stream RPC in any call style.</p><dl class="method"><dt id="grpc.StreamStreamMultiCallable.__call__"><code class="descname">__call__</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout=None</em>, <em>metadata=None</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#StreamStreamMultiCallable.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.StreamStreamMultiCallable.__call__" title="Permalink to this definition">¶</a></dt><dd><p>Invokes the underlying RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>request_iterator</strong> – An iterator that yields request values for the RPC.</li><li><strong>timeout</strong> – An optional duration of time in seconds to allow for the RPC.</li><li><strong>metadata</strong> – Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to theservice-side of the RPC.</li><li><strong>credentials</strong> – An optional CallCredentials for the RPC.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An object that is both a Call for the RPC and an iterator of response</dt><dd><p class="first last">values. Drawing response values from the returned iterator may raiseRpcError indicating termination of the RPC with non-OK status.</p></dd></dl></p></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.Channel"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">Channel</code><a class="reference internal" href="_modules/grpc.html#Channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Affords RPC invocation via generic methods.</p><dl class="method"><dt id="grpc.Channel.stream_stream"><code class="descname">stream_stream</code><span class="sig-paren">(</span><em>method</em>, <em>request_serializer=None</em>, <em>response_deserializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.stream_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.stream_stream" title="Permalink to this definition">¶</a></dt><dd><p>Creates a StreamStreamMultiCallable for a stream-stream method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>method</strong> – The name of the RPC method.</li><li><strong>request_serializer</strong> – Optional behaviour for serializing the requestmessage. Request goes unserialized in case None is passed.</li><li><strong>response_deserializer</strong> – Optional behaviour for deserializing the responsemessage. Response goes undeserialized in case None is passed.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StreamStreamMultiCallable value for the named stream-stream method.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Channel.stream_unary"><code class="descname">stream_unary</code><span class="sig-paren">(</span><em>method</em>, <em>request_serializer=None</em>, <em>response_deserializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.stream_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.stream_unary" title="Permalink to this definition">¶</a></dt><dd><p>Creates a StreamUnaryMultiCallable for a stream-unary method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>method</strong> – The name of the RPC method.</li><li><strong>request_serializer</strong> – Optional behaviour for serializing the requestmessage. Request goes unserialized in case None is passed.</li><li><strong>response_deserializer</strong> – Optional behaviour for deserializing the responsemessage. Response goes undeserialized in case None is passed.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StreamUnaryMultiCallable value for the named stream-unary method.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Channel.subscribe"><code class="descname">subscribe</code><span class="sig-paren">(</span><em>callback</em>, <em>try_to_connect=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.subscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.subscribe" title="Permalink to this definition">¶</a></dt><dd><p>Subscribes to this Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"><li><strong>callback</strong> – A callable to be invoked and passed a ChannelConnectivity valuedescribing this Channel’s connectivity. The callable will be invokedimmediately upon subscription and again for every change to thisChannel’s connectivity thereafter until it is unsubscribed or thisChannel object goes out of scope.</li><li><strong>try_to_connect</strong> – A boolean indicating whether or not this Channel shouldattempt to connect if it is not already connected and ready to conductRPCs.</li></ul></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Channel.unary_stream"><code class="descname">unary_stream</code><span class="sig-paren">(</span><em>method</em>, <em>request_serializer=None</em>, <em>response_deserializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.unary_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.unary_stream" title="Permalink to this definition">¶</a></dt><dd><p>Creates a UnaryStreamMultiCallable for a unary-stream method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>method</strong> – The name of the RPC method.</li><li><strong>request_serializer</strong> – Optional behaviour for serializing the requestmessage. Request goes unserialized in case None is passed.</li><li><strong>response_deserializer</strong> – Optional behaviour for deserializing the responsemessage. Response goes undeserialized in case None is passed.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A UnaryStreamMultiCallable value for the name unary-stream method.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Channel.unary_unary"><code class="descname">unary_unary</code><span class="sig-paren">(</span><em>method</em>, <em>request_serializer=None</em>, <em>response_deserializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.unary_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.unary_unary" title="Permalink to this definition">¶</a></dt><dd><p>Creates a UnaryUnaryMultiCallable for a unary-unary method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>method</strong> – The name of the RPC method.</li><li><strong>request_serializer</strong> – Optional behaviour for serializing the requestmessage. Request goes unserialized in case None is passed.</li><li><strong>response_deserializer</strong> – Optional behaviour for deserializing the responsemessage. Response goes undeserialized in case None is passed.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A UnaryUnaryMultiCallable value for the named unary-unary method.</p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Channel.unsubscribe"><code class="descname">unsubscribe</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Channel.unsubscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Channel.unsubscribe" title="Permalink to this definition">¶</a></dt><dd><p>Unsubscribes a callback from this Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – A callable previously registered with this Channel from havingbeen passed to its “subscribe” method.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.ServicerContext"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">ServicerContext</code><a class="reference internal" href="_modules/grpc.html#ServicerContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <a class="reference internal" href="#grpc.RpcContext" title="grpc.RpcContext"><code class="xref py py-class docutils literal"><span class="pre">grpc.RpcContext</span></code></a></p><p>A context object passed to method implementations.</p><dl class="method"><dt id="grpc.ServicerContext.invocation_metadata"><code class="descname">invocation_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.invocation_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.invocation_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accesses the metadata from the invocation-side of the RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The invocation <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.ServicerContext.peer"><code class="descname">peer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.peer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.peer" title="Permalink to this definition">¶</a></dt><dd><p>Identifies the peer that invoked the RPC being serviced.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A string identifying the peer that invoked the RPC being serviced.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.ServicerContext.send_initial_metadata"><code class="descname">send_initial_metadata</code><span class="sig-paren">(</span><em>initial_metadata</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.send_initial_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.send_initial_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Sends the initial metadata value to the invocation-side of the RPC.</p><p>This method need not be called by method implementations if they have noservice-side initial metadata to transmit.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>initial_metadata</strong> – The initial <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.ServicerContext.set_code"><code class="descname">set_code</code><span class="sig-paren">(</span><em>code</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.set_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.set_code" title="Permalink to this definition">¶</a></dt><dd><p>Accepts the status code of the RPC.</p><p>This method need not be called by method implementations if they wish thegRPC runtime to determine the status code of the RPC.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>code</strong> – A StatusCode value to be transmitted to the invocation side of theRPC as the status code of the RPC.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.ServicerContext.set_details"><code class="descname">set_details</code><span class="sig-paren">(</span><em>details</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.set_details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.set_details" title="Permalink to this definition">¶</a></dt><dd><p>Accepts the service-side details of the RPC.</p><p>This method need not be called by method implementations if they have nodetails to transmit.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>details</strong> – A string to be transmitted to the invocation side of the RPC asthe status details of the RPC.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.ServicerContext.set_trailing_metadata"><code class="descname">set_trailing_metadata</code><span class="sig-paren">(</span><em>trailing_metadata</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ServicerContext.set_trailing_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ServicerContext.set_trailing_metadata" title="Permalink to this definition">¶</a></dt><dd><p>Accepts the trailing metadata value of the RPC.</p><p>This method need not be called by method implementations if they have noservice-side trailing metadata to transmit.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trailing_metadata</strong> – The trailing <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.RpcMethodHandler"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">RpcMethodHandler</code><a class="reference internal" href="_modules/grpc.html#RpcMethodHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.RpcMethodHandler" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>An implementation of a single RPC method.</p><dl class="attribute"><dt id="grpc.RpcMethodHandler.request_streaming"><code class="descname">request_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_streaming" title="Permalink to this definition">¶</a></dt><dd><p>Whether the RPC supports exactly one request message orany arbitrary number of request messages.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.response_streaming"><code class="descname">response_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_streaming" title="Permalink to this definition">¶</a></dt><dd><p>Whether the RPC supports exactly one response message orany arbitrary number of response messages.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.request_deserializer"><code class="descname">request_deserializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_deserializer" title="Permalink to this definition">¶</a></dt><dd><p>A callable behavior that accepts a byte string andreturns an object suitable to be passed to this object’s business logic,or None to indicate that this object’s business logic should be passed theraw request bytes.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.response_serializer"><code class="descname">response_serializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_serializer" title="Permalink to this definition">¶</a></dt><dd><p>A callable behavior that accepts an object produced bythis object’s business logic and returns a byte string, or None toindicate that the byte strings produced by this object’s business logicshould be transmitted on the wire as they are.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.unary_unary"><code class="descname">unary_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_unary" title="Permalink to this definition">¶</a></dt><dd><p>This object’s application-specific business logic as a callablevalue that takes a request value and a ServicerContext object and returnsa response value. Only non-None if both request_streaming andresponse_streaming are False.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.unary_stream"><code class="descname">unary_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_stream" title="Permalink to this definition">¶</a></dt><dd><p>This object’s application-specific business logic as acallable value that takes a request value and a ServicerContext object andreturns an iterator of response values. Only non-None if request_streamingis False and response_streaming is True.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.stream_unary"><code class="descname">stream_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_unary" title="Permalink to this definition">¶</a></dt><dd><p>This object’s application-specific business logic as acallable value that takes an iterator of request values and aServicerContext object and returns a response value. Only non-None ifrequest_streaming is True and response_streaming is False.</p></dd></dl><dl class="attribute"><dt id="grpc.RpcMethodHandler.stream_stream"><code class="descname">stream_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_stream" title="Permalink to this definition">¶</a></dt><dd><p>This object’s application-specific business logic as acallable value that takes an iterator of request values and aServicerContext object and returns an iterator of response values. Onlynon-None if request_streaming and response_streaming are both True.</p></dd></dl></dd></dl><dl class="class"><dt id="grpc.HandlerCallDetails"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">HandlerCallDetails</code><a class="reference internal" href="_modules/grpc.html#HandlerCallDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.HandlerCallDetails" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Describes an RPC that has just arrived for service... attribute:: method</p><blockquote><div>The method name of the RPC.</div></blockquote><dl class="attribute"><dt id="grpc.HandlerCallDetails.invocation_metadata"><code class="descname">invocation_metadata</code><a class="headerlink" href="#grpc.HandlerCallDetails.invocation_metadata" title="Permalink to this definition">¶</a></dt><dd><p>The <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> from the invocation side of the RPC.</p></dd></dl></dd></dl><dl class="class"><dt id="grpc.GenericRpcHandler"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">GenericRpcHandler</code><a class="reference internal" href="_modules/grpc.html#GenericRpcHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.GenericRpcHandler" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>An implementation of arbitrarily many RPC methods.</p><dl class="method"><dt id="grpc.GenericRpcHandler.service"><code class="descname">service</code><span class="sig-paren">(</span><em>handler_call_details</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#GenericRpcHandler.service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.GenericRpcHandler.service" title="Permalink to this definition">¶</a></dt><dd><p>Services an RPC (or not).</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>handler_call_details</strong> – A HandlerCallDetails describing the RPC.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>An RpcMethodHandler with which the RPC may be serviced, or None to</dt><dd>indicate that this object will not be servicing the RPC.</dd></dl></td></tr></tbody></table></dd></dl></dd></dl><dl class="class"><dt id="grpc.Server"><em class="property">class </em><code class="descclassname">grpc.</code><code class="descname">Server</code><a class="reference internal" href="_modules/grpc.html#Server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Server" title="Permalink to this definition">¶</a></dt><dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p><p>Services RPCs.</p><dl class="method"><dt id="grpc.Server.add_generic_rpc_handlers"><code class="descname">add_generic_rpc_handlers</code><span class="sig-paren">(</span><em>generic_rpc_handlers</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Server.add_generic_rpc_handlers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.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><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>generic_rpc_handlers</strong> – An iterable of GenericRpcHandlers that will be usedto service RPCs after this Server is started.</td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Server.add_insecure_port"><code class="descname">add_insecure_port</code><span class="sig-paren">(</span><em>address</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Server.add_insecure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Server.add_insecure_port" title="Permalink to this definition">¶</a></dt><dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p><p>This method may only be called before calling this Server’s start method iscalled.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> – The address for which to open a port.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>An integer port on which RPCs will be serviced after this link has been</dt><dd>started. This is typically the same number as the port number containedin the passed address, but will likely be different if the port numbercontained in the passed address was zero.</dd></dl></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Server.add_secure_port"><code class="descname">add_secure_port</code><span class="sig-paren">(</span><em>address</em>, <em>server_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Server.add_secure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Server.add_secure_port" title="Permalink to this definition">¶</a></dt><dd><p>Reserves a port for secure RPC service after this Server becomes active.</p><p>This method may only be called before calling this Server’s start method iscalled.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>address</strong> – The address for which to open a port.</li><li><strong>server_credentials</strong> – A ServerCredentials.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An integer port on which RPCs will be serviced after this link has been</dt><dd><p class="first last">started. This is typically the same number as the port number containedin the passed address, but will likely be different if the port numbercontained in the passed address was zero.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="method"><dt id="grpc.Server.start"><code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Server.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Server.start" title="Permalink to this definition">¶</a></dt><dd><p>Starts this Server’s service of RPCs.</p><p>This method may only be called while the server is not serving RPCs (i.e. itis not idempotent).</p></dd></dl><dl class="method"><dt id="grpc.Server.stop"><code class="descname">stop</code><span class="sig-paren">(</span><em>grace</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#Server.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.Server.stop" title="Permalink to this definition">¶</a></dt><dd><p>Stops this Server’s service of RPCs.</p><p>All calls to this method immediately stop service of new RPCs. When existingRPCs are aborted is controlled by the grace period parameter passed to thismethod.</p><p>This method may be called at any time and is idempotent. Passing a smallergrace value than has been passed in a previous call will have the effect ofstopping the Server sooner. Passing a larger grace value than has beenpassed in a previous call will not have the effect of stopping the serverlater.</p><p>This method does not block for any significant length of time. If None ispassed as the grace value, existing RPCs are immediately aborted and thismethod blocks until this Server is completely stopped.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>grace</strong> – A duration of time in seconds or None. If a duration of time inseconds, the time to allow existing RPCs to complete before beingaborted by this Server’s stopping. If None, all RPCs will be abortedimmediately and this method will block until this Server is completelystopped.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A threading.Event that will be set when this Server has completelystopped. The returned event may not be set until after the full graceperiod (if some ongoing RPC continues for the full length of the period)of it may be set much sooner (such as if this Server had no RPCs underwayat the time it was stopped or if all RPCs that it had underway completedvery early in the grace period).</td></tr></tbody></table></dd></dl></dd></dl><dl class="function"><dt id="grpc.unary_unary_rpc_method_handler"><code class="descclassname">grpc.</code><code class="descname">unary_unary_rpc_method_handler</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer=None</em>, <em>response_serializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#unary_unary_rpc_method_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.unary_unary_rpc_method_handler" title="Permalink to this definition">¶</a></dt><dd><p>Creates an RpcMethodHandler for a unary-unary RPC method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>behavior</strong> – The implementation of an RPC method as a callable behavior takinga single request value and returning a single response value.</li><li><strong>request_deserializer</strong> – An optional request deserialization behavior.</li><li><strong>response_serializer</strong> – An optional response serialization behavior.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An RpcMethodHandler for a unary-unary RPC method constructed from the given</dt><dd><p class="first last">parameters.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.unary_stream_rpc_method_handler"><code class="descclassname">grpc.</code><code class="descname">unary_stream_rpc_method_handler</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer=None</em>, <em>response_serializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#unary_stream_rpc_method_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.unary_stream_rpc_method_handler" title="Permalink to this definition">¶</a></dt><dd><p>Creates an RpcMethodHandler for a unary-stream RPC method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>behavior</strong> – The implementation of an RPC method as a callable behavior takinga single request value and returning an iterator of response values.</li><li><strong>request_deserializer</strong> – An optional request deserialization behavior.</li><li><strong>response_serializer</strong> – An optional response serialization behavior.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An RpcMethodHandler for a unary-stream RPC method constructed from the</dt><dd><p class="first last">given parameters.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.stream_unary_rpc_method_handler"><code class="descclassname">grpc.</code><code class="descname">stream_unary_rpc_method_handler</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer=None</em>, <em>response_serializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#stream_unary_rpc_method_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.stream_unary_rpc_method_handler" title="Permalink to this definition">¶</a></dt><dd><p>Creates an RpcMethodHandler for a stream-unary RPC method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>behavior</strong> – The implementation of an RPC method as a callable behavior takingan iterator of request values and returning a single response value.</li><li><strong>request_deserializer</strong> – An optional request deserialization behavior.</li><li><strong>response_serializer</strong> – An optional response serialization behavior.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An RpcMethodHandler for a stream-unary RPC method constructed from the</dt><dd><p class="first last">given parameters.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.stream_stream_rpc_method_handler"><code class="descclassname">grpc.</code><code class="descname">stream_stream_rpc_method_handler</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer=None</em>, <em>response_serializer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#stream_stream_rpc_method_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.stream_stream_rpc_method_handler" title="Permalink to this definition">¶</a></dt><dd><p>Creates an RpcMethodHandler for a stream-stream RPC method.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>behavior</strong> – The implementation of an RPC method as a callable behavior takingan iterator of request values and returning an iterator of responsevalues.</li><li><strong>request_deserializer</strong> – An optional request deserialization behavior.</li><li><strong>response_serializer</strong> – An optional response serialization behavior.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>An RpcMethodHandler for a stream-stream RPC method constructed from the</dt><dd><p class="first last">given parameters.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.method_handlers_generic_handler"><code class="descclassname">grpc.</code><code class="descname">method_handlers_generic_handler</code><span class="sig-paren">(</span><em>service</em>, <em>method_handlers</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#method_handlers_generic_handler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.method_handlers_generic_handler" title="Permalink to this definition">¶</a></dt><dd><p>Creates a grpc.GenericRpcHandler from RpcMethodHandlers.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>service</strong> – A service name to be used for the given method handlers.</li><li><strong>method_handlers</strong> – A dictionary from method name to RpcMethodHandlerimplementing the named method.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A GenericRpcHandler constructed from the given parameters.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.ssl_channel_credentials"><code class="descclassname">grpc.</code><code class="descname">ssl_channel_credentials</code><span class="sig-paren">(</span><em>root_certificates=None</em>, <em>private_key=None</em>, <em>certificate_chain=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ssl_channel_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ssl_channel_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Creates a ChannelCredentials for use with an SSL-enabled Channel.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>root_certificates</strong> – The PEM-encoded root certificates or unset to ask forthem to be retrieved from a default location.</li><li><strong>private_key</strong> – The PEM-encoded private key to use or unset if no private keyshould be used.</li><li><strong>certificate_chain</strong> – The PEM-encoded certificate chain to use or unset if nocertificate chain should be used.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A ChannelCredentials for use with an SSL-enabled Channel.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.metadata_call_credentials"><code class="descclassname">grpc.</code><code class="descname">metadata_call_credentials</code><span class="sig-paren">(</span><em>metadata_plugin</em>, <em>name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#metadata_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.metadata_call_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Construct CallCredentials from an AuthMetadataPlugin.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>metadata_plugin</strong> – An AuthMetadataPlugin to use as the authentication behaviorin the created CallCredentials.</li><li><strong>name</strong> – A name for the plugin.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A CallCredentials.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.access_token_call_credentials"><code class="descclassname">grpc.</code><code class="descname">access_token_call_credentials</code><span class="sig-paren">(</span><em>access_token</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#access_token_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.access_token_call_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Construct CallCredentials from an access token.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>access_token</strong> – A string to place directly in the http requestauthorization header, ie “authorization: Bearer <access_token>”.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials.</td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.composite_call_credentials"><code class="descclassname">grpc.</code><code class="descname">composite_call_credentials</code><span class="sig-paren">(</span><em>*call_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#composite_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.composite_call_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Compose multiple CallCredentials to make a new CallCredentials.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>*call_credentials</strong> – At least two CallCredentials objects.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials object composed of the given CallCredentials objects.</td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.composite_channel_credentials"><code class="descclassname">grpc.</code><code class="descname">composite_channel_credentials</code><span class="sig-paren">(</span><em>channel_credentials</em>, <em>*call_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#composite_channel_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.composite_channel_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Compose a ChannelCredentials and one or more CallCredentials objects.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>channel_credentials</strong> – A ChannelCredentials.</li><li><strong>*call_credentials</strong> – One or more CallCredentials objects.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils"><dt>A ChannelCredentials composed of the given ChannelCredentials and</dt><dd><p class="first last">CallCredentials objects.</p></dd></dl></p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.ssl_server_credentials"><code class="descclassname">grpc.</code><code class="descname">ssl_server_credentials</code><span class="sig-paren">(</span><em>private_key_certificate_chain_pairs</em>, <em>root_certificates=None</em>, <em>require_client_auth=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#ssl_server_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.ssl_server_credentials" title="Permalink to this definition">¶</a></dt><dd><p>Creates a ServerCredentials for use with an SSL-enabled Server.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>private_key_certificate_chain_pairs</strong> – A nonempty sequence each element ofwhich is a pair the first element of which is a PEM-encoded private keyand the second element of which is the corresponding PEM-encodedcertificate chain.</li><li><strong>root_certificates</strong> – PEM-encoded client root certificates to be used forverifying authenticated clients. If omitted, require_client_auth must alsobe omitted or be False.</li><li><strong>require_client_auth</strong> – A boolean indicating whether or not to require clientsto be authenticated. May only be True if root_certificates is not None.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A ServerCredentials for use with an SSL-enabled Server.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.channel_ready_future"><code class="descclassname">grpc.</code><code class="descname">channel_ready_future</code><span class="sig-paren">(</span><em>channel</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#channel_ready_future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.channel_ready_future" title="Permalink to this definition">¶</a></dt><dd><p>Creates a Future tracking when a Channel is ready.</p><p>Cancelling the returned Future does not tell the given Channel to abandonattempts it may have been making to connect; cancelling merely deactivates thereturned Future’s subscription to the given Channel’s connectivity.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> – A Channel.</td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"><dt>A Future that matures when the given Channel has connectivity</dt><dd>ChannelConnectivity.READY.</dd></dl></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.insecure_channel"><code class="descclassname">grpc.</code><code class="descname">insecure_channel</code><span class="sig-paren">(</span><em>target</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#insecure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.insecure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates an insecure Channel to a server.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>target</strong> – The target to which to connect.</li><li><strong>options</strong> – A sequence of string-value pairs according to which to configurethe created channel.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Channel to the target through which RPCs may be conducted.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.secure_channel"><code class="descclassname">grpc.</code><code class="descname">secure_channel</code><span class="sig-paren">(</span><em>target</em>, <em>credentials</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#secure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.secure_channel" title="Permalink to this definition">¶</a></dt><dd><p>Creates a secure Channel to a server.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>target</strong> – The target to which to connect.</li><li><strong>credentials</strong> – A ChannelCredentials instance.</li><li><strong>options</strong> – A sequence of string-value pairs according to which to configurethe created channel.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Channel to the target through which RPCs may be conducted.</p></td></tr></tbody></table></dd></dl><dl class="function"><dt id="grpc.server"><code class="descclassname">grpc.</code><code class="descname">server</code><span class="sig-paren">(</span><em>thread_pool</em>, <em>handlers=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.server" title="Permalink to this definition">¶</a></dt><dd><p>Creates a Server with which RPCs can be serviced.</p><table class="docutils field-list" frame="void" rules="none"><col class="field-name" /><col class="field-body" /><tbody valign="top"><tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"><li><strong>thread_pool</strong> – A futures.ThreadPoolExecutor to be used by the returned Serverto service RPCs.</li><li><strong>handlers</strong> – An optional sequence of GenericRpcHandlers to be used to serviceRPCs after the returned Server is started. These handlers need not be theonly handlers the server will use to service RPCs; other handlers maylater be added by calling add_generic_rpc_handlers any time before thereturned Server is started.</li></ul></td></tr><tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Server with which RPCs can be serviced.</p></td></tr></tbody></table></dd></dl></div></div><div class="section" id="glossary"><h1>Glossary<a class="headerlink" href="#glossary" title="Permalink to this headline">¶</a></h1><dl class="glossary docutils"><dt id="term-metadatum">metadatum</dt><dd>A key-value pair included in the HTTP header.  It is a2-tuple where the first entry is the key and thesecond is the value, i.e. (key, value).  The metadata key is an ASCII str,and must be a valid HTTP header name.  The metadata value can beeither a valid HTTP ASCII str, or bytes.  If bytes are provided,the key must end with ‘-bin’, i.e.<code class="docutils literal"><span class="pre">('binary-metadata-bin',</span> <span class="pre">b'\x00\xFF')</span></code></dd><dt id="term-metadata">metadata</dt><dd>A sequence of metadatum.</dd></dl></div>           </div>          </div>          <footer>      <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">              <a href="grpc.beta.html" class="btn btn-neutral float-right" title="grpc.beta package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>                    <a href="index.html" class="btn btn-neutral" title="Welcome to grpcio’s documentation!" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>          </div>    <hr/>  <div role="contentinfo">    <p>        © Copyright 2016, Author.    </p>  </div>  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer>        </div>      </div>    </section>  </div>        <script type="text/javascript">        var DOCUMENTATION_OPTIONS = {            URL_ROOT:'./',            VERSION:'1.0.4',            COLLAPSE_INDEX:false,            FILE_SUFFIX:'.html',            HAS_SOURCE:  true        };    </script>      <script type="text/javascript" src="_static/jquery.js"></script>      <script type="text/javascript" src="_static/underscore.js"></script>      <script type="text/javascript" src="_static/doctools.js"></script>          <script type="text/javascript" src="_static/js/theme.js"></script>        <script type="text/javascript">      jQuery(function () {          SphinxRtdTheme.StickyNav.enable();      });  </script>   </body></html>
 |