grpc.html 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>grpc package &mdash; grpcio 1.0.1rc1 documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <link rel="index" title="Index"
  10. href="genindex.html"/>
  11. <link rel="search" title="Search" href="search.html"/>
  12. <link rel="top" title="grpcio 1.0.1rc1 documentation" href="index.html"/>
  13. <link rel="next" title="grpc.beta package" href="grpc.beta.html"/>
  14. <link rel="prev" title="Welcome to grpcio’s documentation!" href="index.html"/>
  15. <script src="_static/js/modernizr.min.js"></script>
  16. </head>
  17. <body class="wy-body-for-nav" role="document">
  18. <div class="wy-grid-for-nav">
  19. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  20. <div class="wy-side-scroll">
  21. <div class="wy-side-nav-search">
  22. <a href="index.html" class="icon icon-home"> grpcio
  23. </a>
  24. <div class="version">
  25. 1.0.1rc1
  26. </div>
  27. <div role="search">
  28. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  29. <input type="text" name="q" placeholder="Search docs" />
  30. <input type="hidden" name="check_keywords" value="yes" />
  31. <input type="hidden" name="area" value="default" />
  32. </form>
  33. </div>
  34. </div>
  35. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  36. <p class="caption"><span class="caption-text">Contents:</span></p>
  37. <ul class="current">
  38. <li class="toctree-l1 current"><a class="current reference internal" href="#">grpc package</a><ul>
  39. <li class="toctree-l2"><a class="reference internal" href="#subpackages">Subpackages</a><ul>
  40. <li class="toctree-l3"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a></li>
  41. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a></li>
  42. </ul>
  43. </li>
  44. <li class="toctree-l2"><a class="reference internal" href="#module-grpc">Module contents</a></li>
  45. </ul>
  46. </li>
  47. <li class="toctree-l1"><a class="reference internal" href="#glossary">Glossary</a></li>
  48. </ul>
  49. </div>
  50. </div>
  51. </nav>
  52. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  53. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  54. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  55. <a href="index.html">grpcio</a>
  56. </nav>
  57. <div class="wy-nav-content">
  58. <div class="rst-content">
  59. <div role="navigation" aria-label="breadcrumbs navigation">
  60. <ul class="wy-breadcrumbs">
  61. <li><a href="index.html">Docs</a> &raquo;</li>
  62. <li>grpc package</li>
  63. <li class="wy-breadcrumbs-aside">
  64. <a href="_sources/grpc.rst.txt" rel="nofollow"> View page source</a>
  65. </li>
  66. </ul>
  67. <hr/>
  68. </div>
  69. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  70. <div itemprop="articleBody">
  71. <div class="section" id="grpc-package">
  72. <h1>grpc package<a class="headerlink" href="#grpc-package" title="Permalink to this headline">¶</a></h1>
  73. <div class="section" id="subpackages">
  74. <h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
  75. <div class="toctree-wrapper compound">
  76. <ul>
  77. <li class="toctree-l1"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a><ul>
  78. <li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#submodules">Submodules</a></li>
  79. <li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.implementations">grpc.beta.implementations module</a></li>
  80. <li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.interfaces">grpc.beta.interfaces module</a></li>
  81. <li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta.utilities">grpc.beta.utilities module</a></li>
  82. <li class="toctree-l2"><a class="reference internal" href="grpc.beta.html#module-grpc.beta">Module contents</a></li>
  83. </ul>
  84. </li>
  85. <li class="toctree-l1"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a><ul>
  86. <li class="toctree-l2"><a class="reference internal" href="grpc.framework.html#subpackages">Subpackages</a><ul>
  87. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.common.html">grpc.framework.common package</a><ul>
  88. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#submodules">Submodules</a></li>
  89. <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>
  90. <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>
  91. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.common.html#module-grpc.framework.common">Module contents</a></li>
  92. </ul>
  93. </li>
  94. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.foundation.html">grpc.framework.foundation package</a><ul>
  95. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#submodules">Submodules</a></li>
  96. <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>
  97. <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>
  98. <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>
  99. <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>
  100. <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>
  101. <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>
  102. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.foundation.html#module-grpc.framework.foundation">Module contents</a></li>
  103. </ul>
  104. </li>
  105. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.interfaces.html">grpc.framework.interfaces package</a><ul>
  106. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.interfaces.html#subpackages">Subpackages</a><ul>
  107. <li class="toctree-l5"><a class="reference internal" href="grpc.framework.interfaces.base.html">grpc.framework.interfaces.base package</a><ul>
  108. <li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#submodules">Submodules</a></li>
  109. <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>
  110. <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>
  111. <li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.base.html#module-grpc.framework.interfaces.base">Module contents</a></li>
  112. </ul>
  113. </li>
  114. <li class="toctree-l5"><a class="reference internal" href="grpc.framework.interfaces.face.html">grpc.framework.interfaces.face package</a><ul>
  115. <li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#submodules">Submodules</a></li>
  116. <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>
  117. <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>
  118. <li class="toctree-l6"><a class="reference internal" href="grpc.framework.interfaces.face.html#module-grpc.framework.interfaces.face">Module contents</a></li>
  119. </ul>
  120. </li>
  121. </ul>
  122. </li>
  123. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.interfaces.html#module-grpc.framework.interfaces">Module contents</a></li>
  124. </ul>
  125. </li>
  126. </ul>
  127. </li>
  128. <li class="toctree-l2"><a class="reference internal" href="grpc.framework.html#module-grpc.framework">Module contents</a></li>
  129. </ul>
  130. </li>
  131. </ul>
  132. </div>
  133. </div>
  134. <div class="section" id="module-grpc">
  135. <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc" title="Permalink to this headline">¶</a></h2>
  136. <p>gRPC&#8217;s Python API.</p>
  137. <dl class="exception">
  138. <dt id="grpc.FutureTimeoutError">
  139. <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>
  140. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
  141. <p>Indicates that a method call on a Future timed out.</p>
  142. </dd></dl>
  143. <dl class="exception">
  144. <dt id="grpc.FutureCancelledError">
  145. <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>
  146. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
  147. <p>Indicates that the computation underlying a Future was cancelled.</p>
  148. </dd></dl>
  149. <dl class="class">
  150. <dt id="grpc.Future">
  151. <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>
  152. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  153. <p>A representation of a computation in another control flow.</p>
  154. <p>Computations represented by a Future may be yet to be begun, may be ongoing,
  155. or may have already completed.</p>
  156. <dl class="method">
  157. <dt id="grpc.Future.add_done_callback">
  158. <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>
  159. <dd><p>Adds a function to be called at completion of the computation.</p>
  160. <p>The callback will be passed this Future object describing the outcome of
  161. the computation.</p>
  162. <p>If the computation has already completed, the callback will be called
  163. immediately.</p>
  164. <table class="docutils field-list" frame="void" rules="none">
  165. <col class="field-name" />
  166. <col class="field-body" />
  167. <tbody valign="top">
  168. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fn</strong> &#8211; A callable taking this Future object as its single parameter.</td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. </dd></dl>
  173. <dl class="method">
  174. <dt id="grpc.Future.cancel">
  175. <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>
  176. <dd><p>Attempts to cancel the computation.</p>
  177. <p>This method does not block.</p>
  178. <table class="docutils field-list" frame="void" rules="none">
  179. <col class="field-name" />
  180. <col class="field-body" />
  181. <tbody valign="top">
  182. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  183. <dt>True if the computation has not yet begun, will not be allowed to take</dt>
  184. <dd>place, and determination of both was possible without blocking. False
  185. under all other circumstances including but not limited to the
  186. computation&#8217;s already having begun, the computation&#8217;s already having
  187. finished, and the computation&#8217;s having been scheduled for execution on a
  188. remote system for which a determination of whether or not it commenced
  189. before being cancelled cannot be made without blocking.</dd>
  190. </dl>
  191. </td>
  192. </tr>
  193. </tbody>
  194. </table>
  195. </dd></dl>
  196. <dl class="method">
  197. <dt id="grpc.Future.cancelled">
  198. <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>
  199. <dd><p>Describes whether the computation was cancelled.</p>
  200. <p>This method does not block.</p>
  201. <table class="docutils field-list" frame="void" rules="none">
  202. <col class="field-name" />
  203. <col class="field-body" />
  204. <tbody valign="top">
  205. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  206. <dt>True if the computation was cancelled any time before its result became</dt>
  207. <dd>immediately available. False under all other circumstances including but
  208. not limited to this object&#8217;s cancel method not having been called and
  209. the computation&#8217;s result having become immediately available.</dd>
  210. </dl>
  211. </td>
  212. </tr>
  213. </tbody>
  214. </table>
  215. </dd></dl>
  216. <dl class="method">
  217. <dt id="grpc.Future.done">
  218. <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>
  219. <dd><p>Describes whether the computation has taken place.</p>
  220. <p>This method does not block.</p>
  221. <table class="docutils field-list" frame="void" rules="none">
  222. <col class="field-name" />
  223. <col class="field-body" />
  224. <tbody valign="top">
  225. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  226. <dt>True if the computation is known to have either completed or have been</dt>
  227. <dd>unscheduled or interrupted. False if the computation may possibly be
  228. executing or scheduled to execute later.</dd>
  229. </dl>
  230. </td>
  231. </tr>
  232. </tbody>
  233. </table>
  234. </dd></dl>
  235. <dl class="method">
  236. <dt id="grpc.Future.exception">
  237. <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>
  238. <dd><p>Return the exception raised by the computation.</p>
  239. <p>This method may return immediately or may block.</p>
  240. <table class="docutils field-list" frame="void" rules="none">
  241. <col class="field-name" />
  242. <col class="field-body" />
  243. <tbody valign="top">
  244. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> &#8211; The length of time in seconds to wait for the computation to
  245. terminate or be cancelled, or None if this method should block until
  246. the computation is terminated or is cancelled no matter how long that
  247. takes.</p>
  248. </td>
  249. </tr>
  250. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
  251. <dt>The exception raised by the computation, or None if the computation did</dt>
  252. <dd><p class="first last">not raise an exception.</p>
  253. </dd>
  254. </dl>
  255. </p>
  256. </td>
  257. </tr>
  258. <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
  259. <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> &#8211; If a timeout value is passed and the computation does
  260. not terminate within the allotted time.</li>
  261. <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> &#8211; If the computation was cancelled.</li>
  262. </ul>
  263. </td>
  264. </tr>
  265. </tbody>
  266. </table>
  267. </dd></dl>
  268. <dl class="method">
  269. <dt id="grpc.Future.result">
  270. <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>
  271. <dd><p>Accesses the outcome of the computation or raises its exception.</p>
  272. <p>This method may return immediately or may block.</p>
  273. <table class="docutils field-list" frame="void" rules="none">
  274. <col class="field-name" />
  275. <col class="field-body" />
  276. <tbody valign="top">
  277. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> &#8211; The length of time in seconds to wait for the computation to
  278. finish or be cancelled, or None if this method should block until the
  279. computation has finished or is cancelled no matter how long that takes.</p>
  280. </td>
  281. </tr>
  282. <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>
  283. </td>
  284. </tr>
  285. <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
  286. <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> &#8211; If a timeout value is passed and the computation does
  287. not terminate within the allotted time.</li>
  288. <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> &#8211; If the computation was cancelled.</li>
  289. <li><code class="xref py py-exc docutils literal"><span class="pre">Exception</span></code> &#8211; If the computation raised an exception, this call will raise
  290. the same exception.</li>
  291. </ul>
  292. </td>
  293. </tr>
  294. </tbody>
  295. </table>
  296. </dd></dl>
  297. <dl class="method">
  298. <dt id="grpc.Future.running">
  299. <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>
  300. <dd><p>Describes whether the computation is taking place.</p>
  301. <p>This method does not block.</p>
  302. <table class="docutils field-list" frame="void" rules="none">
  303. <col class="field-name" />
  304. <col class="field-body" />
  305. <tbody valign="top">
  306. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  307. <dt>True if the computation is scheduled to take place in the future or is</dt>
  308. <dd>taking place now, or False if the computation took place in the past or
  309. was cancelled.</dd>
  310. </dl>
  311. </td>
  312. </tr>
  313. </tbody>
  314. </table>
  315. </dd></dl>
  316. <dl class="method">
  317. <dt id="grpc.Future.traceback">
  318. <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>
  319. <dd><p>Access the traceback of the exception raised by the computation.</p>
  320. <p>This method may return immediately or may block.</p>
  321. <table class="docutils field-list" frame="void" rules="none">
  322. <col class="field-name" />
  323. <col class="field-body" />
  324. <tbody valign="top">
  325. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>timeout</strong> &#8211; The length of time in seconds to wait for the computation to
  326. terminate or be cancelled, or None if this method should block until
  327. the computation is terminated or is cancelled no matter how long that
  328. takes.</p>
  329. </td>
  330. </tr>
  331. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
  332. <dt>The traceback of the exception raised by the computation, or None if the</dt>
  333. <dd><p class="first last">computation did not raise an exception.</p>
  334. </dd>
  335. </dl>
  336. </p>
  337. </td>
  338. </tr>
  339. <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
  340. <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> &#8211; If a timeout value is passed and the computation does
  341. not terminate within the allotted time.</li>
  342. <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> &#8211; If the computation was cancelled.</li>
  343. </ul>
  344. </td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. </dd></dl>
  349. </dd></dl>
  350. <dl class="class">
  351. <dt id="grpc.ChannelConnectivity">
  352. <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>
  353. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  354. <p>Mirrors grpc_connectivity_state in the gRPC Core.</p>
  355. <dl class="attribute">
  356. <dt id="grpc.ChannelConnectivity.IDLE">
  357. <code class="descname">IDLE</code><a class="headerlink" href="#grpc.ChannelConnectivity.IDLE" title="Permalink to this definition">¶</a></dt>
  358. <dd><p>The channel is idle.</p>
  359. </dd></dl>
  360. <dl class="attribute">
  361. <dt id="grpc.ChannelConnectivity.CONNECTING">
  362. <code class="descname">CONNECTING</code><a class="headerlink" href="#grpc.ChannelConnectivity.CONNECTING" title="Permalink to this definition">¶</a></dt>
  363. <dd><p>The channel is connecting.</p>
  364. </dd></dl>
  365. <dl class="attribute">
  366. <dt id="grpc.ChannelConnectivity.READY">
  367. <code class="descname">READY</code><a class="headerlink" href="#grpc.ChannelConnectivity.READY" title="Permalink to this definition">¶</a></dt>
  368. <dd><p>The channel is ready to conduct RPCs.</p>
  369. </dd></dl>
  370. <dl class="attribute">
  371. <dt id="grpc.ChannelConnectivity.TRANSIENT_FAILURE">
  372. <code class="descname">TRANSIENT_FAILURE</code><a class="headerlink" href="#grpc.ChannelConnectivity.TRANSIENT_FAILURE" title="Permalink to this definition">¶</a></dt>
  373. <dd><p>The channel has seen a failure from which it expects to
  374. recover.</p>
  375. </dd></dl>
  376. <dl class="attribute">
  377. <dt id="grpc.ChannelConnectivity.SHUTDOWN">
  378. <code class="descname">SHUTDOWN</code><a class="headerlink" href="#grpc.ChannelConnectivity.SHUTDOWN" title="Permalink to this definition">¶</a></dt>
  379. <dd><p>The channel has seen a failure from which it cannot recover.</p>
  380. </dd></dl>
  381. <dl class="attribute">
  382. <dt>
  383. <code class="descname">CONNECTING</code><em class="property"> = &lt;ChannelConnectivity.CONNECTING: (1, 'connecting')&gt;</em></dt>
  384. <dd></dd></dl>
  385. <dl class="attribute">
  386. <dt>
  387. <code class="descname">IDLE</code><em class="property"> = &lt;ChannelConnectivity.IDLE: (0, 'idle')&gt;</em></dt>
  388. <dd></dd></dl>
  389. <dl class="attribute">
  390. <dt>
  391. <code class="descname">READY</code><em class="property"> = &lt;ChannelConnectivity.READY: (2, 'ready')&gt;</em></dt>
  392. <dd></dd></dl>
  393. <dl class="attribute">
  394. <dt>
  395. <code class="descname">SHUTDOWN</code><em class="property"> = &lt;ChannelConnectivity.SHUTDOWN: (4, 'shutdown')&gt;</em></dt>
  396. <dd></dd></dl>
  397. <dl class="attribute">
  398. <dt>
  399. <code class="descname">TRANSIENT_FAILURE</code><em class="property"> = &lt;ChannelConnectivity.TRANSIENT_FAILURE: (3, 'transient failure')&gt;</em></dt>
  400. <dd></dd></dl>
  401. </dd></dl>
  402. <dl class="class">
  403. <dt id="grpc.StatusCode">
  404. <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>
  405. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  406. <p>Mirrors grpc_status_code in the gRPC Core.</p>
  407. <dl class="attribute">
  408. <dt id="grpc.StatusCode.ABORTED">
  409. <code class="descname">ABORTED</code><em class="property"> = &lt;StatusCode.ABORTED: (10, 'aborted')&gt;</em><a class="headerlink" href="#grpc.StatusCode.ABORTED" title="Permalink to this definition">¶</a></dt>
  410. <dd></dd></dl>
  411. <dl class="attribute">
  412. <dt id="grpc.StatusCode.ALREADY_EXISTS">
  413. <code class="descname">ALREADY_EXISTS</code><em class="property"> = &lt;StatusCode.ALREADY_EXISTS: (6, 'already exists')&gt;</em><a class="headerlink" href="#grpc.StatusCode.ALREADY_EXISTS" title="Permalink to this definition">¶</a></dt>
  414. <dd></dd></dl>
  415. <dl class="attribute">
  416. <dt id="grpc.StatusCode.CANCELLED">
  417. <code class="descname">CANCELLED</code><em class="property"> = &lt;StatusCode.CANCELLED: (1, 'cancelled')&gt;</em><a class="headerlink" href="#grpc.StatusCode.CANCELLED" title="Permalink to this definition">¶</a></dt>
  418. <dd></dd></dl>
  419. <dl class="attribute">
  420. <dt id="grpc.StatusCode.DATA_LOSS">
  421. <code class="descname">DATA_LOSS</code><em class="property"> = &lt;StatusCode.DATA_LOSS: (15, 'data loss')&gt;</em><a class="headerlink" href="#grpc.StatusCode.DATA_LOSS" title="Permalink to this definition">¶</a></dt>
  422. <dd></dd></dl>
  423. <dl class="attribute">
  424. <dt id="grpc.StatusCode.DEADLINE_EXCEEDED">
  425. <code class="descname">DEADLINE_EXCEEDED</code><em class="property"> = &lt;StatusCode.DEADLINE_EXCEEDED: (4, 'deadline exceeded')&gt;</em><a class="headerlink" href="#grpc.StatusCode.DEADLINE_EXCEEDED" title="Permalink to this definition">¶</a></dt>
  426. <dd></dd></dl>
  427. <dl class="attribute">
  428. <dt id="grpc.StatusCode.FAILED_PRECONDITION">
  429. <code class="descname">FAILED_PRECONDITION</code><em class="property"> = &lt;StatusCode.FAILED_PRECONDITION: (9, 'failed precondition')&gt;</em><a class="headerlink" href="#grpc.StatusCode.FAILED_PRECONDITION" title="Permalink to this definition">¶</a></dt>
  430. <dd></dd></dl>
  431. <dl class="attribute">
  432. <dt id="grpc.StatusCode.INTERNAL">
  433. <code class="descname">INTERNAL</code><em class="property"> = &lt;StatusCode.INTERNAL: (13, 'internal')&gt;</em><a class="headerlink" href="#grpc.StatusCode.INTERNAL" title="Permalink to this definition">¶</a></dt>
  434. <dd></dd></dl>
  435. <dl class="attribute">
  436. <dt id="grpc.StatusCode.INVALID_ARGUMENT">
  437. <code class="descname">INVALID_ARGUMENT</code><em class="property"> = &lt;StatusCode.INVALID_ARGUMENT: (3, 'invalid argument')&gt;</em><a class="headerlink" href="#grpc.StatusCode.INVALID_ARGUMENT" title="Permalink to this definition">¶</a></dt>
  438. <dd></dd></dl>
  439. <dl class="attribute">
  440. <dt id="grpc.StatusCode.NOT_FOUND">
  441. <code class="descname">NOT_FOUND</code><em class="property"> = &lt;StatusCode.NOT_FOUND: (5, 'not found')&gt;</em><a class="headerlink" href="#grpc.StatusCode.NOT_FOUND" title="Permalink to this definition">¶</a></dt>
  442. <dd></dd></dl>
  443. <dl class="attribute">
  444. <dt id="grpc.StatusCode.OK">
  445. <code class="descname">OK</code><em class="property"> = &lt;StatusCode.OK: (0, 'ok')&gt;</em><a class="headerlink" href="#grpc.StatusCode.OK" title="Permalink to this definition">¶</a></dt>
  446. <dd></dd></dl>
  447. <dl class="attribute">
  448. <dt id="grpc.StatusCode.OUT_OF_RANGE">
  449. <code class="descname">OUT_OF_RANGE</code><em class="property"> = &lt;StatusCode.OUT_OF_RANGE: (11, 'out of range')&gt;</em><a class="headerlink" href="#grpc.StatusCode.OUT_OF_RANGE" title="Permalink to this definition">¶</a></dt>
  450. <dd></dd></dl>
  451. <dl class="attribute">
  452. <dt id="grpc.StatusCode.PERMISSION_DENIED">
  453. <code class="descname">PERMISSION_DENIED</code><em class="property"> = &lt;StatusCode.PERMISSION_DENIED: (7, 'permission denied')&gt;</em><a class="headerlink" href="#grpc.StatusCode.PERMISSION_DENIED" title="Permalink to this definition">¶</a></dt>
  454. <dd></dd></dl>
  455. <dl class="attribute">
  456. <dt id="grpc.StatusCode.RESOURCE_EXHAUSTED">
  457. <code class="descname">RESOURCE_EXHAUSTED</code><em class="property"> = &lt;StatusCode.RESOURCE_EXHAUSTED: (8, 'resource exhausted')&gt;</em><a class="headerlink" href="#grpc.StatusCode.RESOURCE_EXHAUSTED" title="Permalink to this definition">¶</a></dt>
  458. <dd></dd></dl>
  459. <dl class="attribute">
  460. <dt id="grpc.StatusCode.UNAUTHENTICATED">
  461. <code class="descname">UNAUTHENTICATED</code><em class="property"> = &lt;StatusCode.UNAUTHENTICATED: (16, 'unauthenticated')&gt;</em><a class="headerlink" href="#grpc.StatusCode.UNAUTHENTICATED" title="Permalink to this definition">¶</a></dt>
  462. <dd></dd></dl>
  463. <dl class="attribute">
  464. <dt id="grpc.StatusCode.UNAVAILABLE">
  465. <code class="descname">UNAVAILABLE</code><em class="property"> = &lt;StatusCode.UNAVAILABLE: (14, 'unavailable')&gt;</em><a class="headerlink" href="#grpc.StatusCode.UNAVAILABLE" title="Permalink to this definition">¶</a></dt>
  466. <dd></dd></dl>
  467. <dl class="attribute">
  468. <dt id="grpc.StatusCode.UNIMPLEMENTED">
  469. <code class="descname">UNIMPLEMENTED</code><em class="property"> = &lt;StatusCode.UNIMPLEMENTED: (12, 'unimplemented')&gt;</em><a class="headerlink" href="#grpc.StatusCode.UNIMPLEMENTED" title="Permalink to this definition">¶</a></dt>
  470. <dd></dd></dl>
  471. <dl class="attribute">
  472. <dt id="grpc.StatusCode.UNKNOWN">
  473. <code class="descname">UNKNOWN</code><em class="property"> = &lt;StatusCode.UNKNOWN: (2, 'unknown')&gt;</em><a class="headerlink" href="#grpc.StatusCode.UNKNOWN" title="Permalink to this definition">¶</a></dt>
  474. <dd></dd></dl>
  475. </dd></dl>
  476. <dl class="exception">
  477. <dt id="grpc.RpcError">
  478. <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>
  479. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
  480. <p>Raised by the gRPC library to indicate non-OK-status RPC termination.</p>
  481. </dd></dl>
  482. <dl class="class">
  483. <dt id="grpc.RpcContext">
  484. <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>
  485. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  486. <p>Provides RPC-related information and action.</p>
  487. <dl class="method">
  488. <dt id="grpc.RpcContext.add_callback">
  489. <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>
  490. <dd><p>Registers a callback to be called on RPC termination.</p>
  491. <table class="docutils field-list" frame="void" rules="none">
  492. <col class="field-name" />
  493. <col class="field-body" />
  494. <tbody valign="top">
  495. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> &#8211; A no-parameter callable to be called on RPC termination.</td>
  496. </tr>
  497. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  498. <dt>True if the callback was added and will be called later; False if the</dt>
  499. <dd>callback was not added and will not later be called (because the RPC
  500. already terminated or some other reason).</dd>
  501. </dl>
  502. </td>
  503. </tr>
  504. </tbody>
  505. </table>
  506. </dd></dl>
  507. <dl class="method">
  508. <dt id="grpc.RpcContext.cancel">
  509. <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>
  510. <dd><p>Cancels the RPC.</p>
  511. <p>Idempotent and has no effect if the RPC has already terminated.</p>
  512. </dd></dl>
  513. <dl class="method">
  514. <dt id="grpc.RpcContext.is_active">
  515. <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>
  516. <dd><p>Describes whether the RPC is active or has terminated.</p>
  517. </dd></dl>
  518. <dl class="method">
  519. <dt id="grpc.RpcContext.time_remaining">
  520. <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>
  521. <dd><p>Describes the length of allowed time remaining for the RPC.</p>
  522. <table class="docutils field-list" frame="void" rules="none">
  523. <col class="field-name" />
  524. <col class="field-body" />
  525. <tbody valign="top">
  526. <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 seconds
  527. remaining for the RPC to complete before it is considered to have timed
  528. out, or None if no deadline was specified for the RPC.</td>
  529. </tr>
  530. </tbody>
  531. </table>
  532. </dd></dl>
  533. </dd></dl>
  534. <dl class="class">
  535. <dt id="grpc.Call">
  536. <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>
  537. <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>
  538. <p>Invocation-side utility object for an RPC.</p>
  539. <dl class="method">
  540. <dt id="grpc.Call.code">
  541. <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>
  542. <dd><p>Accesses the status code emitted by the service-side of the RPC.</p>
  543. <p>This method blocks until the value is available.</p>
  544. <table class="docutils field-list" frame="void" rules="none">
  545. <col class="field-name" />
  546. <col class="field-body" />
  547. <tbody valign="top">
  548. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The StatusCode value for the RPC.</td>
  549. </tr>
  550. </tbody>
  551. </table>
  552. </dd></dl>
  553. <dl class="method">
  554. <dt id="grpc.Call.details">
  555. <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>
  556. <dd><p>Accesses the details value emitted by the service-side of the RPC.</p>
  557. <p>This method blocks until the value is available.</p>
  558. <table class="docutils field-list" frame="void" rules="none">
  559. <col class="field-name" />
  560. <col class="field-body" />
  561. <tbody valign="top">
  562. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The details string of the RPC.</td>
  563. </tr>
  564. </tbody>
  565. </table>
  566. </dd></dl>
  567. <dl class="method">
  568. <dt id="grpc.Call.initial_metadata">
  569. <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>
  570. <dd><p>Accesses the initial metadata from the service-side of the RPC.</p>
  571. <p>This method blocks until the value is available.</p>
  572. <table class="docutils field-list" frame="void" rules="none">
  573. <col class="field-name" />
  574. <col class="field-body" />
  575. <tbody valign="top">
  576. <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>
  577. </tr>
  578. </tbody>
  579. </table>
  580. </dd></dl>
  581. <dl class="method">
  582. <dt id="grpc.Call.trailing_metadata">
  583. <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>
  584. <dd><p>Accesses the trailing metadata from the service-side of the RPC.</p>
  585. <p>This method blocks until the value is available.</p>
  586. <table class="docutils field-list" frame="void" rules="none">
  587. <col class="field-name" />
  588. <col class="field-body" />
  589. <tbody valign="top">
  590. <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>
  591. </tr>
  592. </tbody>
  593. </table>
  594. </dd></dl>
  595. </dd></dl>
  596. <dl class="class">
  597. <dt id="grpc.ChannelCredentials">
  598. <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>
  599. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  600. <p>A value encapsulating the data required to create a secure Channel.</p>
  601. <p>This class has no supported interface - it exists to define the type of its
  602. instances and its instances exist to be passed to other functions.</p>
  603. </dd></dl>
  604. <dl class="class">
  605. <dt id="grpc.CallCredentials">
  606. <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>
  607. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  608. <p>A value encapsulating data asserting an identity over a channel.</p>
  609. <p>A CallCredentials may be composed with ChannelCredentials to always assert
  610. identity for every call over that Channel.</p>
  611. <p>This class has no supported interface - it exists to define the type of its
  612. instances and its instances exist to be passed to other functions.</p>
  613. </dd></dl>
  614. <dl class="class">
  615. <dt id="grpc.AuthMetadataContext">
  616. <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>
  617. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  618. <p>Provides information to call credentials metadata plugins.</p>
  619. <dl class="attribute">
  620. <dt id="grpc.AuthMetadataContext.service_url">
  621. <code class="descname">service_url</code><a class="headerlink" href="#grpc.AuthMetadataContext.service_url" title="Permalink to this definition">¶</a></dt>
  622. <dd><p>A string URL of the service being called into.</p>
  623. </dd></dl>
  624. <dl class="attribute">
  625. <dt id="grpc.AuthMetadataContext.method_name">
  626. <code class="descname">method_name</code><a class="headerlink" href="#grpc.AuthMetadataContext.method_name" title="Permalink to this definition">¶</a></dt>
  627. <dd><p>A string of the fully qualified method name being called.</p>
  628. </dd></dl>
  629. </dd></dl>
  630. <dl class="class">
  631. <dt id="grpc.AuthMetadataPluginCallback">
  632. <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>
  633. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  634. <p>Callback object received by a metadata plugin.</p>
  635. <dl class="method">
  636. <dt id="grpc.AuthMetadataPluginCallback.__call__">
  637. <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>
  638. <dd><p>Inform the gRPC runtime of the metadata to construct a CallCredentials.</p>
  639. <table class="docutils field-list" frame="void" rules="none">
  640. <col class="field-name" />
  641. <col class="field-body" />
  642. <tbody valign="top">
  643. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  644. <li><strong>metadata</strong> &#8211; The <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> used to construct the CallCredentials.</li>
  645. <li><strong>error</strong> &#8211; An Exception to indicate error or None to indicate success.</li>
  646. </ul>
  647. </td>
  648. </tr>
  649. </tbody>
  650. </table>
  651. </dd></dl>
  652. </dd></dl>
  653. <dl class="class">
  654. <dt id="grpc.AuthMetadataPlugin">
  655. <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>
  656. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  657. <p>A specification for custom authentication.</p>
  658. <dl class="method">
  659. <dt id="grpc.AuthMetadataPlugin.__call__">
  660. <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>
  661. <dd><p>Implements authentication by passing metadata to a callback.</p>
  662. <p>Implementations of this method must not block.</p>
  663. <table class="docutils field-list" frame="void" rules="none">
  664. <col class="field-name" />
  665. <col class="field-body" />
  666. <tbody valign="top">
  667. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  668. <li><strong>context</strong> &#8211; An AuthMetadataContext providing information on the RPC that the
  669. plugin is being called to authenticate.</li>
  670. <li><strong>callback</strong> &#8211; An AuthMetadataPluginCallback to be invoked either synchronously
  671. or asynchronously.</li>
  672. </ul>
  673. </td>
  674. </tr>
  675. </tbody>
  676. </table>
  677. </dd></dl>
  678. </dd></dl>
  679. <dl class="class">
  680. <dt id="grpc.ServerCredentials">
  681. <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>
  682. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  683. <p>A value encapsulating the data required to open a secure port on a Server.</p>
  684. <p>This class has no supported interface - it exists to define the type of its
  685. instances and its instances exist to be passed to other functions.</p>
  686. </dd></dl>
  687. <dl class="class">
  688. <dt id="grpc.UnaryUnaryMultiCallable">
  689. <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>
  690. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  691. <p>Affords invoking a unary-unary RPC.</p>
  692. <dl class="method">
  693. <dt id="grpc.UnaryUnaryMultiCallable.__call__">
  694. <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>
  695. <dd><p>Synchronously invokes the underlying RPC.</p>
  696. <table class="docutils field-list" frame="void" rules="none">
  697. <col class="field-name" />
  698. <col class="field-body" />
  699. <tbody valign="top">
  700. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  701. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  702. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  703. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  704. service-side of the RPC.</li>
  705. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  706. </ul>
  707. </td>
  708. </tr>
  709. <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>
  710. </td>
  711. </tr>
  712. <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> &#8211; Indicating that the RPC terminated with non-OK status. The
  713. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  714. metadata, status code, and details.</p>
  715. </td>
  716. </tr>
  717. </tbody>
  718. </table>
  719. </dd></dl>
  720. <dl class="method">
  721. <dt id="grpc.UnaryUnaryMultiCallable.future">
  722. <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>
  723. <dd><p>Asynchronously invokes the underlying RPC.</p>
  724. <table class="docutils field-list" frame="void" rules="none">
  725. <col class="field-name" />
  726. <col class="field-body" />
  727. <tbody valign="top">
  728. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  729. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  730. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  731. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  732. service-side of the RPC.</li>
  733. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  734. </ul>
  735. </td>
  736. </tr>
  737. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  738. <dt>An object that is both a Call for the RPC and a Future. In the event of</dt>
  739. <dd><p class="first last">RPC completion, the return Future&#8217;s result value will be the response
  740. message of the RPC. Should the event terminate with non-OK status, the
  741. returned Future&#8217;s exception value will be an RpcError.</p>
  742. </dd>
  743. </dl>
  744. </p>
  745. </td>
  746. </tr>
  747. </tbody>
  748. </table>
  749. </dd></dl>
  750. <dl class="method">
  751. <dt id="grpc.UnaryUnaryMultiCallable.with_call">
  752. <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>
  753. <dd><p>Synchronously invokes the underlying RPC.</p>
  754. <table class="docutils field-list" frame="void" rules="none">
  755. <col class="field-name" />
  756. <col class="field-body" />
  757. <tbody valign="top">
  758. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  759. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  760. <li><strong>timeout</strong> &#8211; An optional durating of time in seconds to allow for the RPC.</li>
  761. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  762. service-side of the RPC.</li>
  763. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  764. </ul>
  765. </td>
  766. </tr>
  767. <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>
  768. </td>
  769. </tr>
  770. <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> &#8211; Indicating that the RPC terminated with non-OK status. The
  771. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  772. metadata, status code, and details.</p>
  773. </td>
  774. </tr>
  775. </tbody>
  776. </table>
  777. </dd></dl>
  778. </dd></dl>
  779. <dl class="class">
  780. <dt id="grpc.UnaryStreamMultiCallable">
  781. <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>
  782. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  783. <p>Affords invoking a unary-stream RPC.</p>
  784. <dl class="method">
  785. <dt id="grpc.UnaryStreamMultiCallable.__call__">
  786. <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>
  787. <dd><p>Invokes the underlying RPC.</p>
  788. <table class="docutils field-list" frame="void" rules="none">
  789. <col class="field-name" />
  790. <col class="field-body" />
  791. <tbody valign="top">
  792. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  793. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  794. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  795. <li><strong>metadata</strong> &#8211; An optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  796. service-side of the RPC.</li>
  797. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  798. </ul>
  799. </td>
  800. </tr>
  801. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  802. <dt>An object that is both a Call for the RPC and an iterator of response</dt>
  803. <dd><p class="first last">values. Drawing response values from the returned iterator may raise
  804. RpcError indicating termination of the RPC with non-OK status.</p>
  805. </dd>
  806. </dl>
  807. </p>
  808. </td>
  809. </tr>
  810. </tbody>
  811. </table>
  812. </dd></dl>
  813. </dd></dl>
  814. <dl class="class">
  815. <dt id="grpc.StreamUnaryMultiCallable">
  816. <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>
  817. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  818. <p>Affords invoking a stream-unary RPC in any call style.</p>
  819. <dl class="method">
  820. <dt id="grpc.StreamUnaryMultiCallable.__call__">
  821. <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>
  822. <dd><p>Synchronously invokes the underlying RPC.</p>
  823. <table class="docutils field-list" frame="void" rules="none">
  824. <col class="field-name" />
  825. <col class="field-body" />
  826. <tbody valign="top">
  827. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  828. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  829. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  830. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  831. service-side of the RPC.</li>
  832. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  833. </ul>
  834. </td>
  835. </tr>
  836. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
  837. <dt>The response value for the RPC, and a Call for the RPC if with_call was</dt>
  838. <dd><p class="first last">set to True at invocation.</p>
  839. </dd>
  840. </dl>
  841. </p>
  842. </td>
  843. </tr>
  844. <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> &#8211; Indicating that the RPC terminated with non-OK status. The
  845. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  846. metadata, status code, and details.</p>
  847. </td>
  848. </tr>
  849. </tbody>
  850. </table>
  851. </dd></dl>
  852. <dl class="method">
  853. <dt id="grpc.StreamUnaryMultiCallable.future">
  854. <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>
  855. <dd><p>Asynchronously invokes the underlying RPC.</p>
  856. <table class="docutils field-list" frame="void" rules="none">
  857. <col class="field-name" />
  858. <col class="field-body" />
  859. <tbody valign="top">
  860. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  861. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  862. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  863. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  864. service-side of the RPC.</li>
  865. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  866. </ul>
  867. </td>
  868. </tr>
  869. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  870. <dt>An object that is both a Call for the RPC and a Future. In the event of</dt>
  871. <dd><p class="first last">RPC completion, the return Future&#8217;s result value will be the response
  872. message of the RPC. Should the event terminate with non-OK status, the
  873. returned Future&#8217;s exception value will be an RpcError.</p>
  874. </dd>
  875. </dl>
  876. </p>
  877. </td>
  878. </tr>
  879. </tbody>
  880. </table>
  881. </dd></dl>
  882. <dl class="method">
  883. <dt id="grpc.StreamUnaryMultiCallable.with_call">
  884. <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>
  885. <dd><p>Synchronously invokes the underlying RPC.</p>
  886. <table class="docutils field-list" frame="void" rules="none">
  887. <col class="field-name" />
  888. <col class="field-body" />
  889. <tbody valign="top">
  890. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  891. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  892. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  893. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  894. service-side of the RPC.</li>
  895. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  896. </ul>
  897. </td>
  898. </tr>
  899. <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>
  900. </td>
  901. </tr>
  902. <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> &#8211; Indicating that the RPC terminated with non-OK status. The
  903. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  904. metadata, status code, and details.</p>
  905. </td>
  906. </tr>
  907. </tbody>
  908. </table>
  909. </dd></dl>
  910. </dd></dl>
  911. <dl class="class">
  912. <dt id="grpc.StreamStreamMultiCallable">
  913. <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>
  914. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  915. <p>Affords invoking a stream-stream RPC in any call style.</p>
  916. <dl class="method">
  917. <dt id="grpc.StreamStreamMultiCallable.__call__">
  918. <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>
  919. <dd><p>Invokes the underlying RPC.</p>
  920. <table class="docutils field-list" frame="void" rules="none">
  921. <col class="field-name" />
  922. <col class="field-body" />
  923. <tbody valign="top">
  924. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  925. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  926. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  927. <li><strong>metadata</strong> &#8211; Optional <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a> to be transmitted to the
  928. service-side of the RPC.</li>
  929. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  930. </ul>
  931. </td>
  932. </tr>
  933. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  934. <dt>An object that is both a Call for the RPC and an iterator of response</dt>
  935. <dd><p class="first last">values. Drawing response values from the returned iterator may raise
  936. RpcError indicating termination of the RPC with non-OK status.</p>
  937. </dd>
  938. </dl>
  939. </p>
  940. </td>
  941. </tr>
  942. </tbody>
  943. </table>
  944. </dd></dl>
  945. </dd></dl>
  946. <dl class="class">
  947. <dt id="grpc.Channel">
  948. <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>
  949. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  950. <p>Affords RPC invocation via generic methods.</p>
  951. <dl class="method">
  952. <dt id="grpc.Channel.stream_stream">
  953. <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>
  954. <dd><p>Creates a StreamStreamMultiCallable for a stream-stream method.</p>
  955. <table class="docutils field-list" frame="void" rules="none">
  956. <col class="field-name" />
  957. <col class="field-body" />
  958. <tbody valign="top">
  959. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  960. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  961. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  962. message. Request goes unserialized in case None is passed.</li>
  963. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  964. message. Response goes undeserialized in case None is passed.</li>
  965. </ul>
  966. </td>
  967. </tr>
  968. <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>
  969. </td>
  970. </tr>
  971. </tbody>
  972. </table>
  973. </dd></dl>
  974. <dl class="method">
  975. <dt id="grpc.Channel.stream_unary">
  976. <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>
  977. <dd><p>Creates a StreamUnaryMultiCallable for a stream-unary method.</p>
  978. <table class="docutils field-list" frame="void" rules="none">
  979. <col class="field-name" />
  980. <col class="field-body" />
  981. <tbody valign="top">
  982. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  983. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  984. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  985. message. Request goes unserialized in case None is passed.</li>
  986. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  987. message. Response goes undeserialized in case None is passed.</li>
  988. </ul>
  989. </td>
  990. </tr>
  991. <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>
  992. </td>
  993. </tr>
  994. </tbody>
  995. </table>
  996. </dd></dl>
  997. <dl class="method">
  998. <dt id="grpc.Channel.subscribe">
  999. <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>
  1000. <dd><p>Subscribes to this Channel&#8217;s connectivity.</p>
  1001. <table class="docutils field-list" frame="void" rules="none">
  1002. <col class="field-name" />
  1003. <col class="field-body" />
  1004. <tbody valign="top">
  1005. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  1006. <li><strong>callback</strong> &#8211; A callable to be invoked and passed a ChannelConnectivity value
  1007. describing this Channel&#8217;s connectivity. The callable will be invoked
  1008. immediately upon subscription and again for every change to this
  1009. Channel&#8217;s connectivity thereafter until it is unsubscribed or this
  1010. Channel object goes out of scope.</li>
  1011. <li><strong>try_to_connect</strong> &#8211; A boolean indicating whether or not this Channel should
  1012. attempt to connect if it is not already connected and ready to conduct
  1013. RPCs.</li>
  1014. </ul>
  1015. </td>
  1016. </tr>
  1017. </tbody>
  1018. </table>
  1019. </dd></dl>
  1020. <dl class="method">
  1021. <dt id="grpc.Channel.unary_stream">
  1022. <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>
  1023. <dd><p>Creates a UnaryStreamMultiCallable for a unary-stream method.</p>
  1024. <table class="docutils field-list" frame="void" rules="none">
  1025. <col class="field-name" />
  1026. <col class="field-body" />
  1027. <tbody valign="top">
  1028. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1029. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  1030. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  1031. message. Request goes unserialized in case None is passed.</li>
  1032. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  1033. message. Response goes undeserialized in case None is passed.</li>
  1034. </ul>
  1035. </td>
  1036. </tr>
  1037. <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>
  1038. </td>
  1039. </tr>
  1040. </tbody>
  1041. </table>
  1042. </dd></dl>
  1043. <dl class="method">
  1044. <dt id="grpc.Channel.unary_unary">
  1045. <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>
  1046. <dd><p>Creates a UnaryUnaryMultiCallable for a unary-unary method.</p>
  1047. <table class="docutils field-list" frame="void" rules="none">
  1048. <col class="field-name" />
  1049. <col class="field-body" />
  1050. <tbody valign="top">
  1051. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1052. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  1053. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  1054. message. Request goes unserialized in case None is passed.</li>
  1055. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  1056. message. Response goes undeserialized in case None is passed.</li>
  1057. </ul>
  1058. </td>
  1059. </tr>
  1060. <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>
  1061. </td>
  1062. </tr>
  1063. </tbody>
  1064. </table>
  1065. </dd></dl>
  1066. <dl class="method">
  1067. <dt id="grpc.Channel.unsubscribe">
  1068. <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>
  1069. <dd><p>Unsubscribes a callback from this Channel&#8217;s connectivity.</p>
  1070. <table class="docutils field-list" frame="void" rules="none">
  1071. <col class="field-name" />
  1072. <col class="field-body" />
  1073. <tbody valign="top">
  1074. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> &#8211; A callable previously registered with this Channel from having
  1075. been passed to its &#8220;subscribe&#8221; method.</td>
  1076. </tr>
  1077. </tbody>
  1078. </table>
  1079. </dd></dl>
  1080. </dd></dl>
  1081. <dl class="class">
  1082. <dt id="grpc.ServicerContext">
  1083. <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>
  1084. <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>
  1085. <p>A context object passed to method implementations.</p>
  1086. <dl class="method">
  1087. <dt id="grpc.ServicerContext.invocation_metadata">
  1088. <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>
  1089. <dd><p>Accesses the metadata from the invocation-side of the RPC.</p>
  1090. <table class="docutils field-list" frame="void" rules="none">
  1091. <col class="field-name" />
  1092. <col class="field-body" />
  1093. <tbody valign="top">
  1094. <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>
  1095. </tr>
  1096. </tbody>
  1097. </table>
  1098. </dd></dl>
  1099. <dl class="method">
  1100. <dt id="grpc.ServicerContext.peer">
  1101. <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>
  1102. <dd><p>Identifies the peer that invoked the RPC being serviced.</p>
  1103. <table class="docutils field-list" frame="void" rules="none">
  1104. <col class="field-name" />
  1105. <col class="field-body" />
  1106. <tbody valign="top">
  1107. <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>
  1108. </tr>
  1109. </tbody>
  1110. </table>
  1111. </dd></dl>
  1112. <dl class="method">
  1113. <dt id="grpc.ServicerContext.send_initial_metadata">
  1114. <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>
  1115. <dd><p>Sends the initial metadata value to the invocation-side of the RPC.</p>
  1116. <p>This method need not be called by method implementations if they have no
  1117. service-side initial metadata to transmit.</p>
  1118. <table class="docutils field-list" frame="void" rules="none">
  1119. <col class="field-name" />
  1120. <col class="field-body" />
  1121. <tbody valign="top">
  1122. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>initial_metadata</strong> &#8211; The initial <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td>
  1123. </tr>
  1124. </tbody>
  1125. </table>
  1126. </dd></dl>
  1127. <dl class="method">
  1128. <dt id="grpc.ServicerContext.set_code">
  1129. <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>
  1130. <dd><p>Accepts the status code of the RPC.</p>
  1131. <p>This method need not be called by method implementations if they wish the
  1132. gRPC runtime to determine the status code of the RPC.</p>
  1133. <table class="docutils field-list" frame="void" rules="none">
  1134. <col class="field-name" />
  1135. <col class="field-body" />
  1136. <tbody valign="top">
  1137. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>code</strong> &#8211; The integer status code of the RPC to be transmitted to the
  1138. invocation side of the RPC.</td>
  1139. </tr>
  1140. </tbody>
  1141. </table>
  1142. </dd></dl>
  1143. <dl class="method">
  1144. <dt id="grpc.ServicerContext.set_details">
  1145. <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>
  1146. <dd><p>Accepts the service-side details of the RPC.</p>
  1147. <p>This method need not be called by method implementations if they have no
  1148. details to transmit.</p>
  1149. <table class="docutils field-list" frame="void" rules="none">
  1150. <col class="field-name" />
  1151. <col class="field-body" />
  1152. <tbody valign="top">
  1153. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>details</strong> &#8211; The details string of the RPC to be transmitted to
  1154. the invocation side of the RPC.</td>
  1155. </tr>
  1156. </tbody>
  1157. </table>
  1158. </dd></dl>
  1159. <dl class="method">
  1160. <dt id="grpc.ServicerContext.set_trailing_metadata">
  1161. <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>
  1162. <dd><p>Accepts the trailing metadata value of the RPC.</p>
  1163. <p>This method need not be called by method implementations if they have no
  1164. service-side trailing metadata to transmit.</p>
  1165. <table class="docutils field-list" frame="void" rules="none">
  1166. <col class="field-name" />
  1167. <col class="field-body" />
  1168. <tbody valign="top">
  1169. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trailing_metadata</strong> &#8211; The trailing <a class="reference internal" href="#term-metadata"><span class="xref std std-term">metadata</span></a>.</td>
  1170. </tr>
  1171. </tbody>
  1172. </table>
  1173. </dd></dl>
  1174. </dd></dl>
  1175. <dl class="class">
  1176. <dt id="grpc.RpcMethodHandler">
  1177. <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>
  1178. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1179. <p>An implementation of a single RPC method.</p>
  1180. <dl class="attribute">
  1181. <dt id="grpc.RpcMethodHandler.request_streaming">
  1182. <code class="descname">request_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_streaming" title="Permalink to this definition">¶</a></dt>
  1183. <dd><p>Whether the RPC supports exactly one request message or
  1184. any arbitrary number of request messages.</p>
  1185. </dd></dl>
  1186. <dl class="attribute">
  1187. <dt id="grpc.RpcMethodHandler.response_streaming">
  1188. <code class="descname">response_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_streaming" title="Permalink to this definition">¶</a></dt>
  1189. <dd><p>Whether the RPC supports exactly one response message or
  1190. any arbitrary number of response messages.</p>
  1191. </dd></dl>
  1192. <dl class="attribute">
  1193. <dt id="grpc.RpcMethodHandler.request_deserializer">
  1194. <code class="descname">request_deserializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_deserializer" title="Permalink to this definition">¶</a></dt>
  1195. <dd><p>A callable behavior that accepts a byte string and
  1196. returns an object suitable to be passed to this object&#8217;s business logic,
  1197. or None to indicate that this object&#8217;s business logic should be passed the
  1198. raw request bytes.</p>
  1199. </dd></dl>
  1200. <dl class="attribute">
  1201. <dt id="grpc.RpcMethodHandler.response_serializer">
  1202. <code class="descname">response_serializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_serializer" title="Permalink to this definition">¶</a></dt>
  1203. <dd><p>A callable behavior that accepts an object produced by
  1204. this object&#8217;s business logic and returns a byte string, or None to
  1205. indicate that the byte strings produced by this object&#8217;s business logic
  1206. should be transmitted on the wire as they are.</p>
  1207. </dd></dl>
  1208. <dl class="attribute">
  1209. <dt id="grpc.RpcMethodHandler.unary_unary">
  1210. <code class="descname">unary_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_unary" title="Permalink to this definition">¶</a></dt>
  1211. <dd><p>This object&#8217;s application-specific business logic as a callable
  1212. value that takes a request value and a ServicerContext object and returns
  1213. a response value. Only non-None if both request_streaming and
  1214. response_streaming are False.</p>
  1215. </dd></dl>
  1216. <dl class="attribute">
  1217. <dt id="grpc.RpcMethodHandler.unary_stream">
  1218. <code class="descname">unary_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_stream" title="Permalink to this definition">¶</a></dt>
  1219. <dd><p>This object&#8217;s application-specific business logic as a
  1220. callable value that takes a request value and a ServicerContext object and
  1221. returns an iterator of response values. Only non-None if request_streaming
  1222. is False and response_streaming is True.</p>
  1223. </dd></dl>
  1224. <dl class="attribute">
  1225. <dt id="grpc.RpcMethodHandler.stream_unary">
  1226. <code class="descname">stream_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_unary" title="Permalink to this definition">¶</a></dt>
  1227. <dd><p>This object&#8217;s application-specific business logic as a
  1228. callable value that takes an iterator of request values and a
  1229. ServicerContext object and returns a response value. Only non-None if
  1230. request_streaming is True and response_streaming is False.</p>
  1231. </dd></dl>
  1232. <dl class="attribute">
  1233. <dt id="grpc.RpcMethodHandler.stream_stream">
  1234. <code class="descname">stream_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_stream" title="Permalink to this definition">¶</a></dt>
  1235. <dd><p>This object&#8217;s application-specific business logic as a
  1236. callable value that takes an iterator of request values and a
  1237. ServicerContext object and returns an iterator of response values. Only
  1238. non-None if request_streaming and response_streaming are both True.</p>
  1239. </dd></dl>
  1240. </dd></dl>
  1241. <dl class="class">
  1242. <dt id="grpc.HandlerCallDetails">
  1243. <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>
  1244. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1245. <p>Describes an RPC that has just arrived for service.
  1246. .. attribute:: method</p>
  1247. <blockquote>
  1248. <div>The method name of the RPC.</div></blockquote>
  1249. <dl class="attribute">
  1250. <dt id="grpc.HandlerCallDetails.invocation_metadata">
  1251. <code class="descname">invocation_metadata</code><a class="headerlink" href="#grpc.HandlerCallDetails.invocation_metadata" title="Permalink to this definition">¶</a></dt>
  1252. <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>
  1253. </dd></dl>
  1254. </dd></dl>
  1255. <dl class="class">
  1256. <dt id="grpc.GenericRpcHandler">
  1257. <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>
  1258. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1259. <p>An implementation of arbitrarily many RPC methods.</p>
  1260. <dl class="method">
  1261. <dt id="grpc.GenericRpcHandler.service">
  1262. <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>
  1263. <dd><p>Services an RPC (or not).</p>
  1264. <table class="docutils field-list" frame="void" rules="none">
  1265. <col class="field-name" />
  1266. <col class="field-body" />
  1267. <tbody valign="top">
  1268. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>handler_call_details</strong> &#8211; A HandlerCallDetails describing the RPC.</td>
  1269. </tr>
  1270. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1271. <dt>An RpcMethodHandler with which the RPC may be serviced, or None to</dt>
  1272. <dd>indicate that this object will not be servicing the RPC.</dd>
  1273. </dl>
  1274. </td>
  1275. </tr>
  1276. </tbody>
  1277. </table>
  1278. </dd></dl>
  1279. </dd></dl>
  1280. <dl class="class">
  1281. <dt id="grpc.Server">
  1282. <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>
  1283. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1284. <p>Services RPCs.</p>
  1285. <dl class="method">
  1286. <dt id="grpc.Server.add_generic_rpc_handlers">
  1287. <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>
  1288. <dd><p>Registers GenericRpcHandlers with this Server.</p>
  1289. <p>This method is only safe to call before the server is started.</p>
  1290. <table class="docutils field-list" frame="void" rules="none">
  1291. <col class="field-name" />
  1292. <col class="field-body" />
  1293. <tbody valign="top">
  1294. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>generic_rpc_handlers</strong> &#8211; An iterable of GenericRpcHandlers that will be used
  1295. to service RPCs after this Server is started.</td>
  1296. </tr>
  1297. </tbody>
  1298. </table>
  1299. </dd></dl>
  1300. <dl class="method">
  1301. <dt id="grpc.Server.add_insecure_port">
  1302. <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>
  1303. <dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p>
  1304. <p>This method may only be called before calling this Server&#8217;s start method is
  1305. called.</p>
  1306. <table class="docutils field-list" frame="void" rules="none">
  1307. <col class="field-name" />
  1308. <col class="field-body" />
  1309. <tbody valign="top">
  1310. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> &#8211; The address for which to open a port.</td>
  1311. </tr>
  1312. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1313. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  1314. <dd>started. This is typically the same number as the port number contained
  1315. in the passed address, but will likely be different if the port number
  1316. contained in the passed address was zero.</dd>
  1317. </dl>
  1318. </td>
  1319. </tr>
  1320. </tbody>
  1321. </table>
  1322. </dd></dl>
  1323. <dl class="method">
  1324. <dt id="grpc.Server.add_secure_port">
  1325. <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>
  1326. <dd><p>Reserves a port for secure RPC service after this Server becomes active.</p>
  1327. <p>This method may only be called before calling this Server&#8217;s start method is
  1328. called.</p>
  1329. <table class="docutils field-list" frame="void" rules="none">
  1330. <col class="field-name" />
  1331. <col class="field-body" />
  1332. <tbody valign="top">
  1333. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1334. <li><strong>address</strong> &#8211; The address for which to open a port.</li>
  1335. <li><strong>server_credentials</strong> &#8211; A ServerCredentials.</li>
  1336. </ul>
  1337. </td>
  1338. </tr>
  1339. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1340. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  1341. <dd><p class="first last">started. This is typically the same number as the port number contained
  1342. in the passed address, but will likely be different if the port number
  1343. contained in the passed address was zero.</p>
  1344. </dd>
  1345. </dl>
  1346. </p>
  1347. </td>
  1348. </tr>
  1349. </tbody>
  1350. </table>
  1351. </dd></dl>
  1352. <dl class="method">
  1353. <dt id="grpc.Server.start">
  1354. <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>
  1355. <dd><p>Starts this Server&#8217;s service of RPCs.</p>
  1356. <p>This method may only be called while the server is not serving RPCs (i.e. it
  1357. is not idempotent).</p>
  1358. </dd></dl>
  1359. <dl class="method">
  1360. <dt id="grpc.Server.stop">
  1361. <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>
  1362. <dd><p>Stops this Server&#8217;s service of RPCs.</p>
  1363. <p>All calls to this method immediately stop service of new RPCs. When existing
  1364. RPCs are aborted is controlled by the grace period parameter passed to this
  1365. method.</p>
  1366. <p>This method may be called at any time and is idempotent. Passing a smaller
  1367. grace value than has been passed in a previous call will have the effect of
  1368. stopping the Server sooner. Passing a larger grace value than has been
  1369. passed in a previous call will not have the effect of stopping the server
  1370. later.</p>
  1371. <table class="docutils field-list" frame="void" rules="none">
  1372. <col class="field-name" />
  1373. <col class="field-body" />
  1374. <tbody valign="top">
  1375. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>grace</strong> &#8211; A duration of time in seconds to allow existing RPCs to complete
  1376. before being aborted by this Server&#8217;s stopping. If None, this method
  1377. will block until the server is completely stopped.</td>
  1378. </tr>
  1379. <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 completely
  1380. stopped. The returned event may not be set until after the full grace
  1381. period (if some ongoing RPC continues for the full length of the period)
  1382. of it may be set much sooner (such as if this Server had no RPCs underway
  1383. at the time it was stopped or if all RPCs that it had underway completed
  1384. very early in the grace period).</td>
  1385. </tr>
  1386. </tbody>
  1387. </table>
  1388. </dd></dl>
  1389. </dd></dl>
  1390. <dl class="function">
  1391. <dt id="grpc.unary_unary_rpc_method_handler">
  1392. <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>
  1393. <dd><p>Creates an RpcMethodHandler for a unary-unary RPC method.</p>
  1394. <table class="docutils field-list" frame="void" rules="none">
  1395. <col class="field-name" />
  1396. <col class="field-body" />
  1397. <tbody valign="top">
  1398. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1399. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1400. a single request value and returning a single response value.</li>
  1401. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1402. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1403. </ul>
  1404. </td>
  1405. </tr>
  1406. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1407. <dt>An RpcMethodHandler for a unary-unary RPC method constructed from the given</dt>
  1408. <dd><p class="first last">parameters.</p>
  1409. </dd>
  1410. </dl>
  1411. </p>
  1412. </td>
  1413. </tr>
  1414. </tbody>
  1415. </table>
  1416. </dd></dl>
  1417. <dl class="function">
  1418. <dt id="grpc.unary_stream_rpc_method_handler">
  1419. <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>
  1420. <dd><p>Creates an RpcMethodHandler for a unary-stream RPC method.</p>
  1421. <table class="docutils field-list" frame="void" rules="none">
  1422. <col class="field-name" />
  1423. <col class="field-body" />
  1424. <tbody valign="top">
  1425. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1426. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1427. a single request value and returning an iterator of response values.</li>
  1428. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1429. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1430. </ul>
  1431. </td>
  1432. </tr>
  1433. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1434. <dt>An RpcMethodHandler for a unary-stream RPC method constructed from the</dt>
  1435. <dd><p class="first last">given parameters.</p>
  1436. </dd>
  1437. </dl>
  1438. </p>
  1439. </td>
  1440. </tr>
  1441. </tbody>
  1442. </table>
  1443. </dd></dl>
  1444. <dl class="function">
  1445. <dt id="grpc.stream_unary_rpc_method_handler">
  1446. <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>
  1447. <dd><p>Creates an RpcMethodHandler for a stream-unary RPC method.</p>
  1448. <table class="docutils field-list" frame="void" rules="none">
  1449. <col class="field-name" />
  1450. <col class="field-body" />
  1451. <tbody valign="top">
  1452. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1453. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1454. an iterator of request values and returning a single response value.</li>
  1455. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1456. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1457. </ul>
  1458. </td>
  1459. </tr>
  1460. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1461. <dt>An RpcMethodHandler for a stream-unary RPC method constructed from the</dt>
  1462. <dd><p class="first last">given parameters.</p>
  1463. </dd>
  1464. </dl>
  1465. </p>
  1466. </td>
  1467. </tr>
  1468. </tbody>
  1469. </table>
  1470. </dd></dl>
  1471. <dl class="function">
  1472. <dt id="grpc.stream_stream_rpc_method_handler">
  1473. <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>
  1474. <dd><p>Creates an RpcMethodHandler for a stream-stream RPC method.</p>
  1475. <table class="docutils field-list" frame="void" rules="none">
  1476. <col class="field-name" />
  1477. <col class="field-body" />
  1478. <tbody valign="top">
  1479. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1480. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1481. an iterator of request values and returning an iterator of response
  1482. values.</li>
  1483. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1484. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1485. </ul>
  1486. </td>
  1487. </tr>
  1488. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1489. <dt>An RpcMethodHandler for a stream-stream RPC method constructed from the</dt>
  1490. <dd><p class="first last">given parameters.</p>
  1491. </dd>
  1492. </dl>
  1493. </p>
  1494. </td>
  1495. </tr>
  1496. </tbody>
  1497. </table>
  1498. </dd></dl>
  1499. <dl class="function">
  1500. <dt id="grpc.method_handlers_generic_handler">
  1501. <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>
  1502. <dd><p>Creates a grpc.GenericRpcHandler from RpcMethodHandlers.</p>
  1503. <table class="docutils field-list" frame="void" rules="none">
  1504. <col class="field-name" />
  1505. <col class="field-body" />
  1506. <tbody valign="top">
  1507. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1508. <li><strong>service</strong> &#8211; A service name to be used for the given method handlers.</li>
  1509. <li><strong>method_handlers</strong> &#8211; A dictionary from method name to RpcMethodHandler
  1510. implementing the named method.</li>
  1511. </ul>
  1512. </td>
  1513. </tr>
  1514. <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>
  1515. </td>
  1516. </tr>
  1517. </tbody>
  1518. </table>
  1519. </dd></dl>
  1520. <dl class="function">
  1521. <dt id="grpc.ssl_channel_credentials">
  1522. <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>
  1523. <dd><p>Creates a ChannelCredentials for use with an SSL-enabled Channel.</p>
  1524. <table class="docutils field-list" frame="void" rules="none">
  1525. <col class="field-name" />
  1526. <col class="field-body" />
  1527. <tbody valign="top">
  1528. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1529. <li><strong>root_certificates</strong> &#8211; The PEM-encoded root certificates or unset to ask for
  1530. them to be retrieved from a default location.</li>
  1531. <li><strong>private_key</strong> &#8211; The PEM-encoded private key to use or unset if no private key
  1532. should be used.</li>
  1533. <li><strong>certificate_chain</strong> &#8211; The PEM-encoded certificate chain to use or unset if no
  1534. certificate chain should be used.</li>
  1535. </ul>
  1536. </td>
  1537. </tr>
  1538. <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>
  1539. </td>
  1540. </tr>
  1541. </tbody>
  1542. </table>
  1543. </dd></dl>
  1544. <dl class="function">
  1545. <dt id="grpc.metadata_call_credentials">
  1546. <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>
  1547. <dd><p>Construct CallCredentials from an AuthMetadataPlugin.</p>
  1548. <table class="docutils field-list" frame="void" rules="none">
  1549. <col class="field-name" />
  1550. <col class="field-body" />
  1551. <tbody valign="top">
  1552. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1553. <li><strong>metadata_plugin</strong> &#8211; An AuthMetadataPlugin to use as the authentication behavior
  1554. in the created CallCredentials.</li>
  1555. <li><strong>name</strong> &#8211; A name for the plugin.</li>
  1556. </ul>
  1557. </td>
  1558. </tr>
  1559. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A CallCredentials.</p>
  1560. </td>
  1561. </tr>
  1562. </tbody>
  1563. </table>
  1564. </dd></dl>
  1565. <dl class="function">
  1566. <dt id="grpc.access_token_call_credentials">
  1567. <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>
  1568. <dd><p>Construct CallCredentials from an access token.</p>
  1569. <table class="docutils field-list" frame="void" rules="none">
  1570. <col class="field-name" />
  1571. <col class="field-body" />
  1572. <tbody valign="top">
  1573. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>access_token</strong> &#8211; A string to place directly in the http request
  1574. authorization header, ie &#8220;authorization: Bearer &lt;access_token&gt;&#8221;.</td>
  1575. </tr>
  1576. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials.</td>
  1577. </tr>
  1578. </tbody>
  1579. </table>
  1580. </dd></dl>
  1581. <dl class="function">
  1582. <dt id="grpc.composite_call_credentials">
  1583. <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>
  1584. <dd><p>Compose multiple CallCredentials to make a new CallCredentials.</p>
  1585. <table class="docutils field-list" frame="void" rules="none">
  1586. <col class="field-name" />
  1587. <col class="field-body" />
  1588. <tbody valign="top">
  1589. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>*call_credentials</strong> &#8211; At least two CallCredentials objects.</td>
  1590. </tr>
  1591. <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>
  1592. </tr>
  1593. </tbody>
  1594. </table>
  1595. </dd></dl>
  1596. <dl class="function">
  1597. <dt id="grpc.composite_channel_credentials">
  1598. <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>
  1599. <dd><p>Compose a ChannelCredentials and one or more CallCredentials objects.</p>
  1600. <table class="docutils field-list" frame="void" rules="none">
  1601. <col class="field-name" />
  1602. <col class="field-body" />
  1603. <tbody valign="top">
  1604. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1605. <li><strong>channel_credentials</strong> &#8211; A ChannelCredentials.</li>
  1606. <li><strong>*call_credentials</strong> &#8211; One or more CallCredentials objects.</li>
  1607. </ul>
  1608. </td>
  1609. </tr>
  1610. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1611. <dt>A ChannelCredentials composed of the given ChannelCredentials and</dt>
  1612. <dd><p class="first last">CallCredentials objects.</p>
  1613. </dd>
  1614. </dl>
  1615. </p>
  1616. </td>
  1617. </tr>
  1618. </tbody>
  1619. </table>
  1620. </dd></dl>
  1621. <dl class="function">
  1622. <dt id="grpc.ssl_server_credentials">
  1623. <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>
  1624. <dd><p>Creates a ServerCredentials for use with an SSL-enabled Server.</p>
  1625. <table class="docutils field-list" frame="void" rules="none">
  1626. <col class="field-name" />
  1627. <col class="field-body" />
  1628. <tbody valign="top">
  1629. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1630. <li><strong>private_key_certificate_chain_pairs</strong> &#8211; A nonempty sequence each element of
  1631. which is a pair the first element of which is a PEM-encoded private key
  1632. and the second element of which is the corresponding PEM-encoded
  1633. certificate chain.</li>
  1634. <li><strong>root_certificates</strong> &#8211; PEM-encoded client root certificates to be used for
  1635. verifying authenticated clients. If omitted, require_client_auth must also
  1636. be omitted or be False.</li>
  1637. <li><strong>require_client_auth</strong> &#8211; A boolean indicating whether or not to require clients
  1638. to be authenticated. May only be True if root_certificates is not None.</li>
  1639. </ul>
  1640. </td>
  1641. </tr>
  1642. <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>
  1643. </td>
  1644. </tr>
  1645. </tbody>
  1646. </table>
  1647. </dd></dl>
  1648. <dl class="function">
  1649. <dt id="grpc.channel_ready_future">
  1650. <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>
  1651. <dd><p>Creates a Future tracking when a Channel is ready.</p>
  1652. <p>Cancelling the returned Future does not tell the given Channel to abandon
  1653. attempts it may have been making to connect; cancelling merely deactivates the
  1654. returned Future&#8217;s subscription to the given Channel&#8217;s connectivity.</p>
  1655. <table class="docutils field-list" frame="void" rules="none">
  1656. <col class="field-name" />
  1657. <col class="field-body" />
  1658. <tbody valign="top">
  1659. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> &#8211; A Channel.</td>
  1660. </tr>
  1661. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1662. <dt>A Future that matures when the given Channel has connectivity</dt>
  1663. <dd>ChannelConnectivity.READY.</dd>
  1664. </dl>
  1665. </td>
  1666. </tr>
  1667. </tbody>
  1668. </table>
  1669. </dd></dl>
  1670. <dl class="function">
  1671. <dt id="grpc.insecure_channel">
  1672. <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>
  1673. <dd><p>Creates an insecure Channel to a server.</p>
  1674. <table class="docutils field-list" frame="void" rules="none">
  1675. <col class="field-name" />
  1676. <col class="field-body" />
  1677. <tbody valign="top">
  1678. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1679. <li><strong>target</strong> &#8211; The target to which to connect.</li>
  1680. <li><strong>options</strong> &#8211; A sequence of string-value pairs according to which to configure
  1681. the created channel.</li>
  1682. </ul>
  1683. </td>
  1684. </tr>
  1685. <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>
  1686. </td>
  1687. </tr>
  1688. </tbody>
  1689. </table>
  1690. </dd></dl>
  1691. <dl class="function">
  1692. <dt id="grpc.secure_channel">
  1693. <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>
  1694. <dd><p>Creates a secure Channel to a server.</p>
  1695. <table class="docutils field-list" frame="void" rules="none">
  1696. <col class="field-name" />
  1697. <col class="field-body" />
  1698. <tbody valign="top">
  1699. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1700. <li><strong>target</strong> &#8211; The target to which to connect.</li>
  1701. <li><strong>credentials</strong> &#8211; A ChannelCredentials instance.</li>
  1702. <li><strong>options</strong> &#8211; A sequence of string-value pairs according to which to configure
  1703. the created channel.</li>
  1704. </ul>
  1705. </td>
  1706. </tr>
  1707. <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>
  1708. </td>
  1709. </tr>
  1710. </tbody>
  1711. </table>
  1712. </dd></dl>
  1713. <dl class="function">
  1714. <dt id="grpc.server">
  1715. <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>
  1716. <dd><p>Creates a Server with which RPCs can be serviced.</p>
  1717. <table class="docutils field-list" frame="void" rules="none">
  1718. <col class="field-name" />
  1719. <col class="field-body" />
  1720. <tbody valign="top">
  1721. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1722. <li><strong>thread_pool</strong> &#8211; A futures.ThreadPoolExecutor to be used by the returned Server
  1723. to service RPCs.</li>
  1724. <li><strong>handlers</strong> &#8211; An optional sequence of GenericRpcHandlers to be used to service
  1725. RPCs after the returned Server is started. These handlers need not be the
  1726. only handlers the server will use to service RPCs; other handlers may
  1727. later be added by calling add_generic_rpc_handlers any time before the
  1728. returned Server is started.</li>
  1729. </ul>
  1730. </td>
  1731. </tr>
  1732. <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>
  1733. </td>
  1734. </tr>
  1735. </tbody>
  1736. </table>
  1737. </dd></dl>
  1738. </div>
  1739. </div>
  1740. <div class="section" id="glossary">
  1741. <h1>Glossary<a class="headerlink" href="#glossary" title="Permalink to this headline">¶</a></h1>
  1742. <dl class="glossary docutils">
  1743. <dt id="term-metadatum">metadatum</dt>
  1744. <dd>A key-value pair included in the HTTP header. It is a
  1745. 2-tuple where the first entry is the key and the
  1746. second is the value, i.e. (key, value). The metadata key is an ASCII str,
  1747. and must be a valid HTTP header name. The metadata value can be
  1748. either a valid HTTP ASCII str, or bytes. If bytes are provided,
  1749. the key must end with &#8216;-bin&#8217;, i.e.
  1750. <code class="docutils literal"><span class="pre">('binary-metadata-bin',</span> <span class="pre">b'\x00\xFF')</span></code></dd>
  1751. <dt id="term-metadata">metadata</dt>
  1752. <dd>A sequence of metadatum.</dd>
  1753. </dl>
  1754. </div>
  1755. </div>
  1756. </div>
  1757. <footer>
  1758. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  1759. <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>
  1760. <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>
  1761. </div>
  1762. <hr/>
  1763. <div role="contentinfo">
  1764. <p>
  1765. &copy; Copyright 2016, Author.
  1766. </p>
  1767. </div>
  1768. 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>.
  1769. </footer>
  1770. </div>
  1771. </div>
  1772. </section>
  1773. </div>
  1774. <script type="text/javascript">
  1775. var DOCUMENTATION_OPTIONS = {
  1776. URL_ROOT:'./',
  1777. VERSION:'1.0.1rc1',
  1778. COLLAPSE_INDEX:false,
  1779. FILE_SUFFIX:'.html',
  1780. HAS_SOURCE: true
  1781. };
  1782. </script>
  1783. <script type="text/javascript" src="_static/jquery.js"></script>
  1784. <script type="text/javascript" src="_static/underscore.js"></script>
  1785. <script type="text/javascript" src="_static/doctools.js"></script>
  1786. <script type="text/javascript" src="_static/js/theme.js"></script>
  1787. <script type="text/javascript">
  1788. jQuery(function () {
  1789. SphinxRtdTheme.StickyNav.enable();
  1790. });
  1791. </script>
  1792. </body>
  1793. </html>