grpc.html 112 KB

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