grpc.html 116 KB

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