grpc.html 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>grpc package &mdash; grpcio 1.0.4 documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <link rel="index" title="Index"
  10. href="genindex.html"/>
  11. <link rel="search" title="Search" href="search.html"/>
  12. <link rel="top" title="grpcio 1.0.4 documentation" href="index.html"/>
  13. <link rel="next" title="grpc.beta package" href="grpc.beta.html"/>
  14. <link rel="prev" title="Welcome to grpcio’s documentation!" href="index.html"/>
  15. <script src="_static/js/modernizr.min.js"></script>
  16. </head>
  17. <body class="wy-body-for-nav" role="document">
  18. <div class="wy-grid-for-nav">
  19. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  20. <div class="wy-side-scroll">
  21. <div class="wy-side-nav-search">
  22. <a href="index.html" class="icon icon-home"> grpcio
  23. </a>
  24. <div class="version">
  25. 1.0.4
  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">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">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. </dd></dl>
  382. <dl class="class">
  383. <dt id="grpc.StatusCode">
  384. <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>
  385. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  386. <p>Mirrors grpc_status_code in the gRPC Core.</p>
  387. </dd></dl>
  388. <dl class="exception">
  389. <dt id="grpc.RpcError">
  390. <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>
  391. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">Exception</span></code></p>
  392. <p>Raised by the gRPC library to indicate non-OK-status RPC termination.</p>
  393. </dd></dl>
  394. <dl class="class">
  395. <dt id="grpc.RpcContext">
  396. <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>
  397. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  398. <p>Provides RPC-related information and action.</p>
  399. <dl class="method">
  400. <dt id="grpc.RpcContext.add_callback">
  401. <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>
  402. <dd><p>Registers a callback to be called on RPC termination.</p>
  403. <table class="docutils field-list" frame="void" rules="none">
  404. <col class="field-name" />
  405. <col class="field-body" />
  406. <tbody valign="top">
  407. <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>
  408. </tr>
  409. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  410. <dt>True if the callback was added and will be called later; False if the</dt>
  411. <dd>callback was not added and will not later be called (because the RPC
  412. already terminated or some other reason).</dd>
  413. </dl>
  414. </td>
  415. </tr>
  416. </tbody>
  417. </table>
  418. </dd></dl>
  419. <dl class="method">
  420. <dt id="grpc.RpcContext.cancel">
  421. <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>
  422. <dd><p>Cancels the RPC.</p>
  423. <p>Idempotent and has no effect if the RPC has already terminated.</p>
  424. </dd></dl>
  425. <dl class="method">
  426. <dt id="grpc.RpcContext.is_active">
  427. <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>
  428. <dd><p>Describes whether the RPC is active or has terminated.</p>
  429. </dd></dl>
  430. <dl class="method">
  431. <dt id="grpc.RpcContext.time_remaining">
  432. <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>
  433. <dd><p>Describes the length of allowed time remaining for the RPC.</p>
  434. <table class="docutils field-list" frame="void" rules="none">
  435. <col class="field-name" />
  436. <col class="field-body" />
  437. <tbody valign="top">
  438. <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
  439. remaining for the RPC to complete before it is considered to have timed
  440. out, or None if no deadline was specified for the RPC.</td>
  441. </tr>
  442. </tbody>
  443. </table>
  444. </dd></dl>
  445. </dd></dl>
  446. <dl class="class">
  447. <dt id="grpc.Call">
  448. <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>
  449. <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>
  450. <p>Invocation-side utility object for an RPC.</p>
  451. <dl class="method">
  452. <dt id="grpc.Call.code">
  453. <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>
  454. <dd><p>Accesses the status code emitted by the service-side of the RPC.</p>
  455. <p>This method blocks until the value is available.</p>
  456. <table class="docutils field-list" frame="void" rules="none">
  457. <col class="field-name" />
  458. <col class="field-body" />
  459. <tbody valign="top">
  460. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The StatusCode value for the RPC.</td>
  461. </tr>
  462. </tbody>
  463. </table>
  464. </dd></dl>
  465. <dl class="method">
  466. <dt id="grpc.Call.details">
  467. <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>
  468. <dd><p>Accesses the details value emitted by the service-side of the RPC.</p>
  469. <p>This method blocks until the value is available.</p>
  470. <table class="docutils field-list" frame="void" rules="none">
  471. <col class="field-name" />
  472. <col class="field-body" />
  473. <tbody valign="top">
  474. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The details string of the RPC.</td>
  475. </tr>
  476. </tbody>
  477. </table>
  478. </dd></dl>
  479. <dl class="method">
  480. <dt id="grpc.Call.initial_metadata">
  481. <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>
  482. <dd><p>Accesses the initial metadata from the service-side of the RPC.</p>
  483. <p>This method blocks until the value is available.</p>
  484. <table class="docutils field-list" frame="void" rules="none">
  485. <col class="field-name" />
  486. <col class="field-body" />
  487. <tbody valign="top">
  488. <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>
  489. </tr>
  490. </tbody>
  491. </table>
  492. </dd></dl>
  493. <dl class="method">
  494. <dt id="grpc.Call.trailing_metadata">
  495. <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>
  496. <dd><p>Accesses the trailing metadata from the service-side of the RPC.</p>
  497. <p>This method blocks until the value is available.</p>
  498. <table class="docutils field-list" frame="void" rules="none">
  499. <col class="field-name" />
  500. <col class="field-body" />
  501. <tbody valign="top">
  502. <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>
  503. </tr>
  504. </tbody>
  505. </table>
  506. </dd></dl>
  507. </dd></dl>
  508. <dl class="class">
  509. <dt id="grpc.ChannelCredentials">
  510. <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>
  511. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  512. <p>A value encapsulating the data required to create a secure Channel.</p>
  513. <p>This class has no supported interface - it exists to define the type of its
  514. instances and its instances exist to be passed to other functions.</p>
  515. </dd></dl>
  516. <dl class="class">
  517. <dt id="grpc.CallCredentials">
  518. <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>
  519. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  520. <p>A value encapsulating data asserting an identity over a channel.</p>
  521. <p>A CallCredentials may be composed with ChannelCredentials to always assert
  522. identity for every call over that Channel.</p>
  523. <p>This class has no supported interface - it exists to define the type of its
  524. instances and its instances exist to be passed to other functions.</p>
  525. </dd></dl>
  526. <dl class="class">
  527. <dt id="grpc.AuthMetadataContext">
  528. <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>
  529. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  530. <p>Provides information to call credentials metadata plugins.</p>
  531. <dl class="attribute">
  532. <dt id="grpc.AuthMetadataContext.service_url">
  533. <code class="descname">service_url</code><a class="headerlink" href="#grpc.AuthMetadataContext.service_url" title="Permalink to this definition">¶</a></dt>
  534. <dd><p>A string URL of the service being called into.</p>
  535. </dd></dl>
  536. <dl class="attribute">
  537. <dt id="grpc.AuthMetadataContext.method_name">
  538. <code class="descname">method_name</code><a class="headerlink" href="#grpc.AuthMetadataContext.method_name" title="Permalink to this definition">¶</a></dt>
  539. <dd><p>A string of the fully qualified method name being called.</p>
  540. </dd></dl>
  541. </dd></dl>
  542. <dl class="class">
  543. <dt id="grpc.AuthMetadataPluginCallback">
  544. <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>
  545. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  546. <p>Callback object received by a metadata plugin.</p>
  547. <dl class="method">
  548. <dt id="grpc.AuthMetadataPluginCallback.__call__">
  549. <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>
  550. <dd><p>Inform the gRPC runtime of the metadata to construct a CallCredentials.</p>
  551. <table class="docutils field-list" frame="void" rules="none">
  552. <col class="field-name" />
  553. <col class="field-body" />
  554. <tbody valign="top">
  555. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  556. <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>
  557. <li><strong>error</strong> &#8211; An Exception to indicate error or None to indicate success.</li>
  558. </ul>
  559. </td>
  560. </tr>
  561. </tbody>
  562. </table>
  563. </dd></dl>
  564. </dd></dl>
  565. <dl class="class">
  566. <dt id="grpc.AuthMetadataPlugin">
  567. <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>
  568. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  569. <p>A specification for custom authentication.</p>
  570. <dl class="method">
  571. <dt id="grpc.AuthMetadataPlugin.__call__">
  572. <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>
  573. <dd><p>Implements authentication by passing metadata to a callback.</p>
  574. <p>Implementations of this method must not block.</p>
  575. <table class="docutils field-list" frame="void" rules="none">
  576. <col class="field-name" />
  577. <col class="field-body" />
  578. <tbody valign="top">
  579. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  580. <li><strong>context</strong> &#8211; An AuthMetadataContext providing information on the RPC that the
  581. plugin is being called to authenticate.</li>
  582. <li><strong>callback</strong> &#8211; An AuthMetadataPluginCallback to be invoked either synchronously
  583. or asynchronously.</li>
  584. </ul>
  585. </td>
  586. </tr>
  587. </tbody>
  588. </table>
  589. </dd></dl>
  590. </dd></dl>
  591. <dl class="class">
  592. <dt id="grpc.ServerCredentials">
  593. <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>
  594. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  595. <p>A value encapsulating the data required to open a secure port on a Server.</p>
  596. <p>This class has no supported interface - it exists to define the type of its
  597. instances and its instances exist to be passed to other functions.</p>
  598. </dd></dl>
  599. <dl class="class">
  600. <dt id="grpc.UnaryUnaryMultiCallable">
  601. <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>
  602. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  603. <p>Affords invoking a unary-unary RPC.</p>
  604. <dl class="method">
  605. <dt id="grpc.UnaryUnaryMultiCallable.__call__">
  606. <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>
  607. <dd><p>Synchronously invokes the underlying RPC.</p>
  608. <table class="docutils field-list" frame="void" rules="none">
  609. <col class="field-name" />
  610. <col class="field-body" />
  611. <tbody valign="top">
  612. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  613. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  614. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  615. <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
  616. service-side of the RPC.</li>
  617. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  618. </ul>
  619. </td>
  620. </tr>
  621. <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>
  622. </td>
  623. </tr>
  624. <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
  625. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  626. metadata, status code, and details.</p>
  627. </td>
  628. </tr>
  629. </tbody>
  630. </table>
  631. </dd></dl>
  632. <dl class="method">
  633. <dt id="grpc.UnaryUnaryMultiCallable.future">
  634. <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>
  635. <dd><p>Asynchronously invokes the underlying RPC.</p>
  636. <table class="docutils field-list" frame="void" rules="none">
  637. <col class="field-name" />
  638. <col class="field-body" />
  639. <tbody valign="top">
  640. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  641. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  642. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  643. <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
  644. service-side of the RPC.</li>
  645. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  646. </ul>
  647. </td>
  648. </tr>
  649. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  650. <dt>An object that is both a Call for the RPC and a Future. In the event of</dt>
  651. <dd><p class="first last">RPC completion, the return Future&#8217;s result value will be the response
  652. message of the RPC. Should the event terminate with non-OK status, the
  653. returned Future&#8217;s exception value will be an RpcError.</p>
  654. </dd>
  655. </dl>
  656. </p>
  657. </td>
  658. </tr>
  659. </tbody>
  660. </table>
  661. </dd></dl>
  662. <dl class="method">
  663. <dt id="grpc.UnaryUnaryMultiCallable.with_call">
  664. <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>
  665. <dd><p>Synchronously invokes the underlying RPC.</p>
  666. <table class="docutils field-list" frame="void" rules="none">
  667. <col class="field-name" />
  668. <col class="field-body" />
  669. <tbody valign="top">
  670. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  671. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  672. <li><strong>timeout</strong> &#8211; An optional durating of time in seconds to allow for the RPC.</li>
  673. <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
  674. service-side of the RPC.</li>
  675. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  676. </ul>
  677. </td>
  678. </tr>
  679. <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>
  680. </td>
  681. </tr>
  682. <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
  683. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  684. metadata, status code, and details.</p>
  685. </td>
  686. </tr>
  687. </tbody>
  688. </table>
  689. </dd></dl>
  690. </dd></dl>
  691. <dl class="class">
  692. <dt id="grpc.UnaryStreamMultiCallable">
  693. <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>
  694. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  695. <p>Affords invoking a unary-stream RPC.</p>
  696. <dl class="method">
  697. <dt id="grpc.UnaryStreamMultiCallable.__call__">
  698. <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>
  699. <dd><p>Invokes the underlying RPC.</p>
  700. <table class="docutils field-list" frame="void" rules="none">
  701. <col class="field-name" />
  702. <col class="field-body" />
  703. <tbody valign="top">
  704. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  705. <li><strong>request</strong> &#8211; The request value for the RPC.</li>
  706. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  707. <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
  708. service-side of the RPC.</li>
  709. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  710. </ul>
  711. </td>
  712. </tr>
  713. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  714. <dt>An object that is both a Call for the RPC and an iterator of response</dt>
  715. <dd><p class="first last">values. Drawing response values from the returned iterator may raise
  716. RpcError indicating termination of the RPC with non-OK status.</p>
  717. </dd>
  718. </dl>
  719. </p>
  720. </td>
  721. </tr>
  722. </tbody>
  723. </table>
  724. </dd></dl>
  725. </dd></dl>
  726. <dl class="class">
  727. <dt id="grpc.StreamUnaryMultiCallable">
  728. <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>
  729. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  730. <p>Affords invoking a stream-unary RPC in any call style.</p>
  731. <dl class="method">
  732. <dt id="grpc.StreamUnaryMultiCallable.__call__">
  733. <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>
  734. <dd><p>Synchronously invokes the underlying RPC.</p>
  735. <table class="docutils field-list" frame="void" rules="none">
  736. <col class="field-name" />
  737. <col class="field-body" />
  738. <tbody valign="top">
  739. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  740. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  741. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  742. <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
  743. service-side of the RPC.</li>
  744. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  745. </ul>
  746. </td>
  747. </tr>
  748. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
  749. <dt>The response value for the RPC, and a Call for the RPC if with_call was</dt>
  750. <dd><p class="first last">set to True at invocation.</p>
  751. </dd>
  752. </dl>
  753. </p>
  754. </td>
  755. </tr>
  756. <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
  757. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  758. metadata, status code, and details.</p>
  759. </td>
  760. </tr>
  761. </tbody>
  762. </table>
  763. </dd></dl>
  764. <dl class="method">
  765. <dt id="grpc.StreamUnaryMultiCallable.future">
  766. <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>
  767. <dd><p>Asynchronously invokes the underlying RPC.</p>
  768. <table class="docutils field-list" frame="void" rules="none">
  769. <col class="field-name" />
  770. <col class="field-body" />
  771. <tbody valign="top">
  772. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  773. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  774. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  775. <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
  776. service-side of the RPC.</li>
  777. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  778. </ul>
  779. </td>
  780. </tr>
  781. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  782. <dt>An object that is both a Call for the RPC and a Future. In the event of</dt>
  783. <dd><p class="first last">RPC completion, the return Future&#8217;s result value will be the response
  784. message of the RPC. Should the event terminate with non-OK status, the
  785. returned Future&#8217;s exception value will be an RpcError.</p>
  786. </dd>
  787. </dl>
  788. </p>
  789. </td>
  790. </tr>
  791. </tbody>
  792. </table>
  793. </dd></dl>
  794. <dl class="method">
  795. <dt id="grpc.StreamUnaryMultiCallable.with_call">
  796. <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>
  797. <dd><p>Synchronously invokes the underlying RPC.</p>
  798. <table class="docutils field-list" frame="void" rules="none">
  799. <col class="field-name" />
  800. <col class="field-body" />
  801. <tbody valign="top">
  802. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  803. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  804. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  805. <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
  806. service-side of the RPC.</li>
  807. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  808. </ul>
  809. </td>
  810. </tr>
  811. <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>
  812. </td>
  813. </tr>
  814. <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
  815. raised RpcError will also be a Call for the RPC affording the RPC&#8217;s
  816. metadata, status code, and details.</p>
  817. </td>
  818. </tr>
  819. </tbody>
  820. </table>
  821. </dd></dl>
  822. </dd></dl>
  823. <dl class="class">
  824. <dt id="grpc.StreamStreamMultiCallable">
  825. <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>
  826. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  827. <p>Affords invoking a stream-stream RPC in any call style.</p>
  828. <dl class="method">
  829. <dt id="grpc.StreamStreamMultiCallable.__call__">
  830. <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>
  831. <dd><p>Invokes the underlying RPC.</p>
  832. <table class="docutils field-list" frame="void" rules="none">
  833. <col class="field-name" />
  834. <col class="field-body" />
  835. <tbody valign="top">
  836. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  837. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  838. <li><strong>timeout</strong> &#8211; An optional duration of time in seconds to allow for the RPC.</li>
  839. <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
  840. service-side of the RPC.</li>
  841. <li><strong>credentials</strong> &#8211; An optional CallCredentials for the RPC.</li>
  842. </ul>
  843. </td>
  844. </tr>
  845. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  846. <dt>An object that is both a Call for the RPC and an iterator of response</dt>
  847. <dd><p class="first last">values. Drawing response values from the returned iterator may raise
  848. RpcError indicating termination of the RPC with non-OK status.</p>
  849. </dd>
  850. </dl>
  851. </p>
  852. </td>
  853. </tr>
  854. </tbody>
  855. </table>
  856. </dd></dl>
  857. </dd></dl>
  858. <dl class="class">
  859. <dt id="grpc.Channel">
  860. <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>
  861. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  862. <p>Affords RPC invocation via generic methods.</p>
  863. <dl class="method">
  864. <dt id="grpc.Channel.stream_stream">
  865. <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>
  866. <dd><p>Creates a StreamStreamMultiCallable for a stream-stream method.</p>
  867. <table class="docutils field-list" frame="void" rules="none">
  868. <col class="field-name" />
  869. <col class="field-body" />
  870. <tbody valign="top">
  871. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  872. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  873. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  874. message. Request goes unserialized in case None is passed.</li>
  875. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  876. message. Response goes undeserialized in case None is passed.</li>
  877. </ul>
  878. </td>
  879. </tr>
  880. <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>
  881. </td>
  882. </tr>
  883. </tbody>
  884. </table>
  885. </dd></dl>
  886. <dl class="method">
  887. <dt id="grpc.Channel.stream_unary">
  888. <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>
  889. <dd><p>Creates a StreamUnaryMultiCallable for a stream-unary method.</p>
  890. <table class="docutils field-list" frame="void" rules="none">
  891. <col class="field-name" />
  892. <col class="field-body" />
  893. <tbody valign="top">
  894. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  895. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  896. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  897. message. Request goes unserialized in case None is passed.</li>
  898. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  899. message. Response goes undeserialized in case None is passed.</li>
  900. </ul>
  901. </td>
  902. </tr>
  903. <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>
  904. </td>
  905. </tr>
  906. </tbody>
  907. </table>
  908. </dd></dl>
  909. <dl class="method">
  910. <dt id="grpc.Channel.subscribe">
  911. <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>
  912. <dd><p>Subscribes to this Channel&#8217;s connectivity.</p>
  913. <table class="docutils field-list" frame="void" rules="none">
  914. <col class="field-name" />
  915. <col class="field-body" />
  916. <tbody valign="top">
  917. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  918. <li><strong>callback</strong> &#8211; A callable to be invoked and passed a ChannelConnectivity value
  919. describing this Channel&#8217;s connectivity. The callable will be invoked
  920. immediately upon subscription and again for every change to this
  921. Channel&#8217;s connectivity thereafter until it is unsubscribed or this
  922. Channel object goes out of scope.</li>
  923. <li><strong>try_to_connect</strong> &#8211; A boolean indicating whether or not this Channel should
  924. attempt to connect if it is not already connected and ready to conduct
  925. RPCs.</li>
  926. </ul>
  927. </td>
  928. </tr>
  929. </tbody>
  930. </table>
  931. </dd></dl>
  932. <dl class="method">
  933. <dt id="grpc.Channel.unary_stream">
  934. <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>
  935. <dd><p>Creates a UnaryStreamMultiCallable for a unary-stream method.</p>
  936. <table class="docutils field-list" frame="void" rules="none">
  937. <col class="field-name" />
  938. <col class="field-body" />
  939. <tbody valign="top">
  940. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  941. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  942. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  943. message. Request goes unserialized in case None is passed.</li>
  944. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  945. message. Response goes undeserialized in case None is passed.</li>
  946. </ul>
  947. </td>
  948. </tr>
  949. <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>
  950. </td>
  951. </tr>
  952. </tbody>
  953. </table>
  954. </dd></dl>
  955. <dl class="method">
  956. <dt id="grpc.Channel.unary_unary">
  957. <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>
  958. <dd><p>Creates a UnaryUnaryMultiCallable for a unary-unary method.</p>
  959. <table class="docutils field-list" frame="void" rules="none">
  960. <col class="field-name" />
  961. <col class="field-body" />
  962. <tbody valign="top">
  963. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  964. <li><strong>method</strong> &#8211; The name of the RPC method.</li>
  965. <li><strong>request_serializer</strong> &#8211; Optional behaviour for serializing the request
  966. message. Request goes unserialized in case None is passed.</li>
  967. <li><strong>response_deserializer</strong> &#8211; Optional behaviour for deserializing the response
  968. message. Response goes undeserialized in case None is passed.</li>
  969. </ul>
  970. </td>
  971. </tr>
  972. <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>
  973. </td>
  974. </tr>
  975. </tbody>
  976. </table>
  977. </dd></dl>
  978. <dl class="method">
  979. <dt id="grpc.Channel.unsubscribe">
  980. <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>
  981. <dd><p>Unsubscribes a callback from this Channel&#8217;s connectivity.</p>
  982. <table class="docutils field-list" frame="void" rules="none">
  983. <col class="field-name" />
  984. <col class="field-body" />
  985. <tbody valign="top">
  986. <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
  987. been passed to its &#8220;subscribe&#8221; method.</td>
  988. </tr>
  989. </tbody>
  990. </table>
  991. </dd></dl>
  992. </dd></dl>
  993. <dl class="class">
  994. <dt id="grpc.ServicerContext">
  995. <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>
  996. <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>
  997. <p>A context object passed to method implementations.</p>
  998. <dl class="method">
  999. <dt id="grpc.ServicerContext.invocation_metadata">
  1000. <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>
  1001. <dd><p>Accesses the metadata from the invocation-side of the RPC.</p>
  1002. <table class="docutils field-list" frame="void" rules="none">
  1003. <col class="field-name" />
  1004. <col class="field-body" />
  1005. <tbody valign="top">
  1006. <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>
  1007. </tr>
  1008. </tbody>
  1009. </table>
  1010. </dd></dl>
  1011. <dl class="method">
  1012. <dt id="grpc.ServicerContext.peer">
  1013. <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>
  1014. <dd><p>Identifies the peer that invoked the RPC being serviced.</p>
  1015. <table class="docutils field-list" frame="void" rules="none">
  1016. <col class="field-name" />
  1017. <col class="field-body" />
  1018. <tbody valign="top">
  1019. <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>
  1020. </tr>
  1021. </tbody>
  1022. </table>
  1023. </dd></dl>
  1024. <dl class="method">
  1025. <dt id="grpc.ServicerContext.send_initial_metadata">
  1026. <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>
  1027. <dd><p>Sends the initial metadata value to the invocation-side of the RPC.</p>
  1028. <p>This method need not be called by method implementations if they have no
  1029. service-side initial metadata to transmit.</p>
  1030. <table class="docutils field-list" frame="void" rules="none">
  1031. <col class="field-name" />
  1032. <col class="field-body" />
  1033. <tbody valign="top">
  1034. <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>
  1035. </tr>
  1036. </tbody>
  1037. </table>
  1038. </dd></dl>
  1039. <dl class="method">
  1040. <dt id="grpc.ServicerContext.set_code">
  1041. <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>
  1042. <dd><p>Accepts the status code of the RPC.</p>
  1043. <p>This method need not be called by method implementations if they wish the
  1044. gRPC runtime to determine the status code of the RPC.</p>
  1045. <table class="docutils field-list" frame="void" rules="none">
  1046. <col class="field-name" />
  1047. <col class="field-body" />
  1048. <tbody valign="top">
  1049. <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
  1050. RPC as the status code of the RPC.</td>
  1051. </tr>
  1052. </tbody>
  1053. </table>
  1054. </dd></dl>
  1055. <dl class="method">
  1056. <dt id="grpc.ServicerContext.set_details">
  1057. <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>
  1058. <dd><p>Accepts the service-side details of the RPC.</p>
  1059. <p>This method need not be called by method implementations if they have no
  1060. details to transmit.</p>
  1061. <table class="docutils field-list" frame="void" rules="none">
  1062. <col class="field-name" />
  1063. <col class="field-body" />
  1064. <tbody valign="top">
  1065. <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
  1066. the status details of the RPC.</td>
  1067. </tr>
  1068. </tbody>
  1069. </table>
  1070. </dd></dl>
  1071. <dl class="method">
  1072. <dt id="grpc.ServicerContext.set_trailing_metadata">
  1073. <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>
  1074. <dd><p>Accepts the trailing metadata value of the RPC.</p>
  1075. <p>This method need not be called by method implementations if they have no
  1076. service-side trailing metadata to transmit.</p>
  1077. <table class="docutils field-list" frame="void" rules="none">
  1078. <col class="field-name" />
  1079. <col class="field-body" />
  1080. <tbody valign="top">
  1081. <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>
  1082. </tr>
  1083. </tbody>
  1084. </table>
  1085. </dd></dl>
  1086. </dd></dl>
  1087. <dl class="class">
  1088. <dt id="grpc.RpcMethodHandler">
  1089. <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>
  1090. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1091. <p>An implementation of a single RPC method.</p>
  1092. <dl class="attribute">
  1093. <dt id="grpc.RpcMethodHandler.request_streaming">
  1094. <code class="descname">request_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_streaming" title="Permalink to this definition">¶</a></dt>
  1095. <dd><p>Whether the RPC supports exactly one request message or
  1096. any arbitrary number of request messages.</p>
  1097. </dd></dl>
  1098. <dl class="attribute">
  1099. <dt id="grpc.RpcMethodHandler.response_streaming">
  1100. <code class="descname">response_streaming</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_streaming" title="Permalink to this definition">¶</a></dt>
  1101. <dd><p>Whether the RPC supports exactly one response message or
  1102. any arbitrary number of response messages.</p>
  1103. </dd></dl>
  1104. <dl class="attribute">
  1105. <dt id="grpc.RpcMethodHandler.request_deserializer">
  1106. <code class="descname">request_deserializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.request_deserializer" title="Permalink to this definition">¶</a></dt>
  1107. <dd><p>A callable behavior that accepts a byte string and
  1108. returns an object suitable to be passed to this object&#8217;s business logic,
  1109. or None to indicate that this object&#8217;s business logic should be passed the
  1110. raw request bytes.</p>
  1111. </dd></dl>
  1112. <dl class="attribute">
  1113. <dt id="grpc.RpcMethodHandler.response_serializer">
  1114. <code class="descname">response_serializer</code><a class="headerlink" href="#grpc.RpcMethodHandler.response_serializer" title="Permalink to this definition">¶</a></dt>
  1115. <dd><p>A callable behavior that accepts an object produced by
  1116. this object&#8217;s business logic and returns a byte string, or None to
  1117. indicate that the byte strings produced by this object&#8217;s business logic
  1118. should be transmitted on the wire as they are.</p>
  1119. </dd></dl>
  1120. <dl class="attribute">
  1121. <dt id="grpc.RpcMethodHandler.unary_unary">
  1122. <code class="descname">unary_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_unary" title="Permalink to this definition">¶</a></dt>
  1123. <dd><p>This object&#8217;s application-specific business logic as a callable
  1124. value that takes a request value and a ServicerContext object and returns
  1125. a response value. Only non-None if both request_streaming and
  1126. response_streaming are False.</p>
  1127. </dd></dl>
  1128. <dl class="attribute">
  1129. <dt id="grpc.RpcMethodHandler.unary_stream">
  1130. <code class="descname">unary_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.unary_stream" title="Permalink to this definition">¶</a></dt>
  1131. <dd><p>This object&#8217;s application-specific business logic as a
  1132. callable value that takes a request value and a ServicerContext object and
  1133. returns an iterator of response values. Only non-None if request_streaming
  1134. is False and response_streaming is True.</p>
  1135. </dd></dl>
  1136. <dl class="attribute">
  1137. <dt id="grpc.RpcMethodHandler.stream_unary">
  1138. <code class="descname">stream_unary</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_unary" title="Permalink to this definition">¶</a></dt>
  1139. <dd><p>This object&#8217;s application-specific business logic as a
  1140. callable value that takes an iterator of request values and a
  1141. ServicerContext object and returns a response value. Only non-None if
  1142. request_streaming is True and response_streaming is False.</p>
  1143. </dd></dl>
  1144. <dl class="attribute">
  1145. <dt id="grpc.RpcMethodHandler.stream_stream">
  1146. <code class="descname">stream_stream</code><a class="headerlink" href="#grpc.RpcMethodHandler.stream_stream" title="Permalink to this definition">¶</a></dt>
  1147. <dd><p>This object&#8217;s application-specific business logic as a
  1148. callable value that takes an iterator of request values and a
  1149. ServicerContext object and returns an iterator of response values. Only
  1150. non-None if request_streaming and response_streaming are both True.</p>
  1151. </dd></dl>
  1152. </dd></dl>
  1153. <dl class="class">
  1154. <dt id="grpc.HandlerCallDetails">
  1155. <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>
  1156. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1157. <p>Describes an RPC that has just arrived for service.
  1158. .. attribute:: method</p>
  1159. <blockquote>
  1160. <div>The method name of the RPC.</div></blockquote>
  1161. <dl class="attribute">
  1162. <dt id="grpc.HandlerCallDetails.invocation_metadata">
  1163. <code class="descname">invocation_metadata</code><a class="headerlink" href="#grpc.HandlerCallDetails.invocation_metadata" title="Permalink to this definition">¶</a></dt>
  1164. <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>
  1165. </dd></dl>
  1166. </dd></dl>
  1167. <dl class="class">
  1168. <dt id="grpc.GenericRpcHandler">
  1169. <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>
  1170. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1171. <p>An implementation of arbitrarily many RPC methods.</p>
  1172. <dl class="method">
  1173. <dt id="grpc.GenericRpcHandler.service">
  1174. <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>
  1175. <dd><p>Services an RPC (or not).</p>
  1176. <table class="docutils field-list" frame="void" rules="none">
  1177. <col class="field-name" />
  1178. <col class="field-body" />
  1179. <tbody valign="top">
  1180. <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>
  1181. </tr>
  1182. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1183. <dt>An RpcMethodHandler with which the RPC may be serviced, or None to</dt>
  1184. <dd>indicate that this object will not be servicing the RPC.</dd>
  1185. </dl>
  1186. </td>
  1187. </tr>
  1188. </tbody>
  1189. </table>
  1190. </dd></dl>
  1191. </dd></dl>
  1192. <dl class="class">
  1193. <dt id="grpc.Server">
  1194. <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>
  1195. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  1196. <p>Services RPCs.</p>
  1197. <dl class="method">
  1198. <dt id="grpc.Server.add_generic_rpc_handlers">
  1199. <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>
  1200. <dd><p>Registers GenericRpcHandlers with this Server.</p>
  1201. <p>This method is only safe to call before the server is started.</p>
  1202. <table class="docutils field-list" frame="void" rules="none">
  1203. <col class="field-name" />
  1204. <col class="field-body" />
  1205. <tbody valign="top">
  1206. <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
  1207. to service RPCs after this Server is started.</td>
  1208. </tr>
  1209. </tbody>
  1210. </table>
  1211. </dd></dl>
  1212. <dl class="method">
  1213. <dt id="grpc.Server.add_insecure_port">
  1214. <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>
  1215. <dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p>
  1216. <p>This method may only be called before calling this Server&#8217;s start method is
  1217. called.</p>
  1218. <table class="docutils field-list" frame="void" rules="none">
  1219. <col class="field-name" />
  1220. <col class="field-body" />
  1221. <tbody valign="top">
  1222. <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>
  1223. </tr>
  1224. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1225. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  1226. <dd>started. This is typically the same number as the port number contained
  1227. in the passed address, but will likely be different if the port number
  1228. contained in the passed address was zero.</dd>
  1229. </dl>
  1230. </td>
  1231. </tr>
  1232. </tbody>
  1233. </table>
  1234. </dd></dl>
  1235. <dl class="method">
  1236. <dt id="grpc.Server.add_secure_port">
  1237. <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>
  1238. <dd><p>Reserves a port for secure RPC service after this Server becomes active.</p>
  1239. <p>This method may only be called before calling this Server&#8217;s start method is
  1240. called.</p>
  1241. <table class="docutils field-list" frame="void" rules="none">
  1242. <col class="field-name" />
  1243. <col class="field-body" />
  1244. <tbody valign="top">
  1245. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1246. <li><strong>address</strong> &#8211; The address for which to open a port.</li>
  1247. <li><strong>server_credentials</strong> &#8211; A ServerCredentials.</li>
  1248. </ul>
  1249. </td>
  1250. </tr>
  1251. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1252. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  1253. <dd><p class="first last">started. This is typically the same number as the port number contained
  1254. in the passed address, but will likely be different if the port number
  1255. contained in the passed address was zero.</p>
  1256. </dd>
  1257. </dl>
  1258. </p>
  1259. </td>
  1260. </tr>
  1261. </tbody>
  1262. </table>
  1263. </dd></dl>
  1264. <dl class="method">
  1265. <dt id="grpc.Server.start">
  1266. <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>
  1267. <dd><p>Starts this Server&#8217;s service of RPCs.</p>
  1268. <p>This method may only be called while the server is not serving RPCs (i.e. it
  1269. is not idempotent).</p>
  1270. </dd></dl>
  1271. <dl class="method">
  1272. <dt id="grpc.Server.stop">
  1273. <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>
  1274. <dd><p>Stops this Server&#8217;s service of RPCs.</p>
  1275. <p>All calls to this method immediately stop service of new RPCs. When existing
  1276. RPCs are aborted is controlled by the grace period parameter passed to this
  1277. method.</p>
  1278. <p>This method may be called at any time and is idempotent. Passing a smaller
  1279. grace value than has been passed in a previous call will have the effect of
  1280. stopping the Server sooner. Passing a larger grace value than has been
  1281. passed in a previous call will not have the effect of stopping the server
  1282. later.</p>
  1283. <p>This method does not block for any significant length of time. If None is
  1284. passed as the grace value, existing RPCs are immediately aborted and this
  1285. method blocks until this Server is completely stopped.</p>
  1286. <table class="docutils field-list" frame="void" rules="none">
  1287. <col class="field-name" />
  1288. <col class="field-body" />
  1289. <tbody valign="top">
  1290. <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
  1291. seconds, the time to allow existing RPCs to complete before being
  1292. aborted by this Server&#8217;s stopping. If None, all RPCs will be aborted
  1293. immediately and this method will block until this Server is completely
  1294. stopped.</td>
  1295. </tr>
  1296. <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
  1297. stopped. The returned event may not be set until after the full grace
  1298. period (if some ongoing RPC continues for the full length of the period)
  1299. of it may be set much sooner (such as if this Server had no RPCs underway
  1300. at the time it was stopped or if all RPCs that it had underway completed
  1301. very early in the grace period).</td>
  1302. </tr>
  1303. </tbody>
  1304. </table>
  1305. </dd></dl>
  1306. </dd></dl>
  1307. <dl class="function">
  1308. <dt id="grpc.unary_unary_rpc_method_handler">
  1309. <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>
  1310. <dd><p>Creates an RpcMethodHandler for a unary-unary RPC method.</p>
  1311. <table class="docutils field-list" frame="void" rules="none">
  1312. <col class="field-name" />
  1313. <col class="field-body" />
  1314. <tbody valign="top">
  1315. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1316. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1317. a single request value and returning a single response value.</li>
  1318. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1319. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1320. </ul>
  1321. </td>
  1322. </tr>
  1323. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1324. <dt>An RpcMethodHandler for a unary-unary RPC method constructed from the given</dt>
  1325. <dd><p class="first last">parameters.</p>
  1326. </dd>
  1327. </dl>
  1328. </p>
  1329. </td>
  1330. </tr>
  1331. </tbody>
  1332. </table>
  1333. </dd></dl>
  1334. <dl class="function">
  1335. <dt id="grpc.unary_stream_rpc_method_handler">
  1336. <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>
  1337. <dd><p>Creates an RpcMethodHandler for a unary-stream RPC method.</p>
  1338. <table class="docutils field-list" frame="void" rules="none">
  1339. <col class="field-name" />
  1340. <col class="field-body" />
  1341. <tbody valign="top">
  1342. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1343. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1344. a single request value and returning an iterator of response values.</li>
  1345. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1346. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1347. </ul>
  1348. </td>
  1349. </tr>
  1350. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1351. <dt>An RpcMethodHandler for a unary-stream RPC method constructed from the</dt>
  1352. <dd><p class="first last">given parameters.</p>
  1353. </dd>
  1354. </dl>
  1355. </p>
  1356. </td>
  1357. </tr>
  1358. </tbody>
  1359. </table>
  1360. </dd></dl>
  1361. <dl class="function">
  1362. <dt id="grpc.stream_unary_rpc_method_handler">
  1363. <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>
  1364. <dd><p>Creates an RpcMethodHandler for a stream-unary RPC method.</p>
  1365. <table class="docutils field-list" frame="void" rules="none">
  1366. <col class="field-name" />
  1367. <col class="field-body" />
  1368. <tbody valign="top">
  1369. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1370. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1371. an iterator of request values and returning a single response value.</li>
  1372. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1373. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1374. </ul>
  1375. </td>
  1376. </tr>
  1377. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1378. <dt>An RpcMethodHandler for a stream-unary RPC method constructed from the</dt>
  1379. <dd><p class="first last">given parameters.</p>
  1380. </dd>
  1381. </dl>
  1382. </p>
  1383. </td>
  1384. </tr>
  1385. </tbody>
  1386. </table>
  1387. </dd></dl>
  1388. <dl class="function">
  1389. <dt id="grpc.stream_stream_rpc_method_handler">
  1390. <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>
  1391. <dd><p>Creates an RpcMethodHandler for a stream-stream RPC method.</p>
  1392. <table class="docutils field-list" frame="void" rules="none">
  1393. <col class="field-name" />
  1394. <col class="field-body" />
  1395. <tbody valign="top">
  1396. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1397. <li><strong>behavior</strong> &#8211; The implementation of an RPC method as a callable behavior taking
  1398. an iterator of request values and returning an iterator of response
  1399. values.</li>
  1400. <li><strong>request_deserializer</strong> &#8211; An optional request deserialization behavior.</li>
  1401. <li><strong>response_serializer</strong> &#8211; An optional response serialization behavior.</li>
  1402. </ul>
  1403. </td>
  1404. </tr>
  1405. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1406. <dt>An RpcMethodHandler for a stream-stream RPC method constructed from the</dt>
  1407. <dd><p class="first last">given parameters.</p>
  1408. </dd>
  1409. </dl>
  1410. </p>
  1411. </td>
  1412. </tr>
  1413. </tbody>
  1414. </table>
  1415. </dd></dl>
  1416. <dl class="function">
  1417. <dt id="grpc.method_handlers_generic_handler">
  1418. <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>
  1419. <dd><p>Creates a grpc.GenericRpcHandler from RpcMethodHandlers.</p>
  1420. <table class="docutils field-list" frame="void" rules="none">
  1421. <col class="field-name" />
  1422. <col class="field-body" />
  1423. <tbody valign="top">
  1424. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1425. <li><strong>service</strong> &#8211; A service name to be used for the given method handlers.</li>
  1426. <li><strong>method_handlers</strong> &#8211; A dictionary from method name to RpcMethodHandler
  1427. implementing the named method.</li>
  1428. </ul>
  1429. </td>
  1430. </tr>
  1431. <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>
  1432. </td>
  1433. </tr>
  1434. </tbody>
  1435. </table>
  1436. </dd></dl>
  1437. <dl class="function">
  1438. <dt id="grpc.ssl_channel_credentials">
  1439. <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>
  1440. <dd><p>Creates a ChannelCredentials for use with an SSL-enabled Channel.</p>
  1441. <table class="docutils field-list" frame="void" rules="none">
  1442. <col class="field-name" />
  1443. <col class="field-body" />
  1444. <tbody valign="top">
  1445. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1446. <li><strong>root_certificates</strong> &#8211; The PEM-encoded root certificates or unset to ask for
  1447. them to be retrieved from a default location.</li>
  1448. <li><strong>private_key</strong> &#8211; The PEM-encoded private key to use or unset if no private key
  1449. should be used.</li>
  1450. <li><strong>certificate_chain</strong> &#8211; The PEM-encoded certificate chain to use or unset if no
  1451. certificate chain should be used.</li>
  1452. </ul>
  1453. </td>
  1454. </tr>
  1455. <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>
  1456. </td>
  1457. </tr>
  1458. </tbody>
  1459. </table>
  1460. </dd></dl>
  1461. <dl class="function">
  1462. <dt id="grpc.metadata_call_credentials">
  1463. <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>
  1464. <dd><p>Construct CallCredentials from an AuthMetadataPlugin.</p>
  1465. <table class="docutils field-list" frame="void" rules="none">
  1466. <col class="field-name" />
  1467. <col class="field-body" />
  1468. <tbody valign="top">
  1469. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1470. <li><strong>metadata_plugin</strong> &#8211; An AuthMetadataPlugin to use as the authentication behavior
  1471. in the created CallCredentials.</li>
  1472. <li><strong>name</strong> &#8211; A name for the plugin.</li>
  1473. </ul>
  1474. </td>
  1475. </tr>
  1476. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A CallCredentials.</p>
  1477. </td>
  1478. </tr>
  1479. </tbody>
  1480. </table>
  1481. </dd></dl>
  1482. <dl class="function">
  1483. <dt id="grpc.access_token_call_credentials">
  1484. <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>
  1485. <dd><p>Construct CallCredentials from an access token.</p>
  1486. <table class="docutils field-list" frame="void" rules="none">
  1487. <col class="field-name" />
  1488. <col class="field-body" />
  1489. <tbody valign="top">
  1490. <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
  1491. authorization header, ie &#8220;authorization: Bearer &lt;access_token&gt;&#8221;.</td>
  1492. </tr>
  1493. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials.</td>
  1494. </tr>
  1495. </tbody>
  1496. </table>
  1497. </dd></dl>
  1498. <dl class="function">
  1499. <dt id="grpc.composite_call_credentials">
  1500. <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>
  1501. <dd><p>Compose multiple CallCredentials to make a new CallCredentials.</p>
  1502. <table class="docutils field-list" frame="void" rules="none">
  1503. <col class="field-name" />
  1504. <col class="field-body" />
  1505. <tbody valign="top">
  1506. <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>
  1507. </tr>
  1508. <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>
  1509. </tr>
  1510. </tbody>
  1511. </table>
  1512. </dd></dl>
  1513. <dl class="function">
  1514. <dt id="grpc.composite_channel_credentials">
  1515. <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>
  1516. <dd><p>Compose a ChannelCredentials and one or more CallCredentials objects.</p>
  1517. <table class="docutils field-list" frame="void" rules="none">
  1518. <col class="field-name" />
  1519. <col class="field-body" />
  1520. <tbody valign="top">
  1521. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1522. <li><strong>channel_credentials</strong> &#8211; A ChannelCredentials.</li>
  1523. <li><strong>*call_credentials</strong> &#8211; One or more CallCredentials objects.</li>
  1524. </ul>
  1525. </td>
  1526. </tr>
  1527. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  1528. <dt>A ChannelCredentials composed of the given ChannelCredentials and</dt>
  1529. <dd><p class="first last">CallCredentials objects.</p>
  1530. </dd>
  1531. </dl>
  1532. </p>
  1533. </td>
  1534. </tr>
  1535. </tbody>
  1536. </table>
  1537. </dd></dl>
  1538. <dl class="function">
  1539. <dt id="grpc.ssl_server_credentials">
  1540. <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>
  1541. <dd><p>Creates a ServerCredentials for use with an SSL-enabled Server.</p>
  1542. <table class="docutils field-list" frame="void" rules="none">
  1543. <col class="field-name" />
  1544. <col class="field-body" />
  1545. <tbody valign="top">
  1546. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1547. <li><strong>private_key_certificate_chain_pairs</strong> &#8211; A nonempty sequence each element of
  1548. which is a pair the first element of which is a PEM-encoded private key
  1549. and the second element of which is the corresponding PEM-encoded
  1550. certificate chain.</li>
  1551. <li><strong>root_certificates</strong> &#8211; PEM-encoded client root certificates to be used for
  1552. verifying authenticated clients. If omitted, require_client_auth must also
  1553. be omitted or be False.</li>
  1554. <li><strong>require_client_auth</strong> &#8211; A boolean indicating whether or not to require clients
  1555. to be authenticated. May only be True if root_certificates is not None.</li>
  1556. </ul>
  1557. </td>
  1558. </tr>
  1559. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A ServerCredentials for use with an SSL-enabled Server.</p>
  1560. </td>
  1561. </tr>
  1562. </tbody>
  1563. </table>
  1564. </dd></dl>
  1565. <dl class="function">
  1566. <dt id="grpc.channel_ready_future">
  1567. <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>
  1568. <dd><p>Creates a Future tracking when a Channel is ready.</p>
  1569. <p>Cancelling the returned Future does not tell the given Channel to abandon
  1570. attempts it may have been making to connect; cancelling merely deactivates the
  1571. returned Future&#8217;s subscription to the given Channel&#8217;s connectivity.</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"><strong>channel</strong> &#8211; A Channel.</td>
  1577. </tr>
  1578. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  1579. <dt>A Future that matures when the given Channel has connectivity</dt>
  1580. <dd>ChannelConnectivity.READY.</dd>
  1581. </dl>
  1582. </td>
  1583. </tr>
  1584. </tbody>
  1585. </table>
  1586. </dd></dl>
  1587. <dl class="function">
  1588. <dt id="grpc.insecure_channel">
  1589. <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>
  1590. <dd><p>Creates an insecure Channel to a server.</p>
  1591. <table class="docutils field-list" frame="void" rules="none">
  1592. <col class="field-name" />
  1593. <col class="field-body" />
  1594. <tbody valign="top">
  1595. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1596. <li><strong>target</strong> &#8211; The target to which to connect.</li>
  1597. <li><strong>options</strong> &#8211; A sequence of string-value pairs according to which to configure
  1598. the created channel.</li>
  1599. </ul>
  1600. </td>
  1601. </tr>
  1602. <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>
  1603. </td>
  1604. </tr>
  1605. </tbody>
  1606. </table>
  1607. </dd></dl>
  1608. <dl class="function">
  1609. <dt id="grpc.secure_channel">
  1610. <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>
  1611. <dd><p>Creates a secure Channel to a server.</p>
  1612. <table class="docutils field-list" frame="void" rules="none">
  1613. <col class="field-name" />
  1614. <col class="field-body" />
  1615. <tbody valign="top">
  1616. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1617. <li><strong>target</strong> &#8211; The target to which to connect.</li>
  1618. <li><strong>credentials</strong> &#8211; A ChannelCredentials instance.</li>
  1619. <li><strong>options</strong> &#8211; A sequence of string-value pairs according to which to configure
  1620. the created channel.</li>
  1621. </ul>
  1622. </td>
  1623. </tr>
  1624. <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>
  1625. </td>
  1626. </tr>
  1627. </tbody>
  1628. </table>
  1629. </dd></dl>
  1630. <dl class="function">
  1631. <dt id="grpc.server">
  1632. <code class="descclassname">grpc.</code><code class="descname">server</code><span class="sig-paren">(</span><em>thread_pool</em>, <em>handlers=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc.html#server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.server" title="Permalink to this definition">¶</a></dt>
  1633. <dd><p>Creates a Server with which RPCs can be serviced.</p>
  1634. <table class="docutils field-list" frame="void" rules="none">
  1635. <col class="field-name" />
  1636. <col class="field-body" />
  1637. <tbody valign="top">
  1638. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  1639. <li><strong>thread_pool</strong> &#8211; A futures.ThreadPoolExecutor to be used by the returned Server
  1640. to service RPCs.</li>
  1641. <li><strong>handlers</strong> &#8211; An optional sequence of GenericRpcHandlers to be used to service
  1642. RPCs after the returned Server is started. These handlers need not be the
  1643. only handlers the server will use to service RPCs; other handlers may
  1644. later be added by calling add_generic_rpc_handlers any time before the
  1645. returned Server is started.</li>
  1646. </ul>
  1647. </td>
  1648. </tr>
  1649. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Server with which RPCs can be serviced.</p>
  1650. </td>
  1651. </tr>
  1652. </tbody>
  1653. </table>
  1654. </dd></dl>
  1655. </div>
  1656. </div>
  1657. <div class="section" id="glossary">
  1658. <h1>Glossary<a class="headerlink" href="#glossary" title="Permalink to this headline">¶</a></h1>
  1659. <dl class="glossary docutils">
  1660. <dt id="term-metadatum">metadatum</dt>
  1661. <dd>A key-value pair included in the HTTP header. It is a
  1662. 2-tuple where the first entry is the key and the
  1663. second is the value, i.e. (key, value). The metadata key is an ASCII str,
  1664. and must be a valid HTTP header name. The metadata value can be
  1665. either a valid HTTP ASCII str, or bytes. If bytes are provided,
  1666. the key must end with &#8216;-bin&#8217;, i.e.
  1667. <code class="docutils literal"><span class="pre">('binary-metadata-bin',</span> <span class="pre">b'\x00\xFF')</span></code></dd>
  1668. <dt id="term-metadata">metadata</dt>
  1669. <dd>A sequence of metadatum.</dd>
  1670. </dl>
  1671. </div>
  1672. </div>
  1673. </div>
  1674. <footer>
  1675. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  1676. <a href="grpc.beta.html" class="btn btn-neutral float-right" title="grpc.beta package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
  1677. <a href="index.html" class="btn btn-neutral" title="Welcome to grpcio’s documentation!" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  1678. </div>
  1679. <hr/>
  1680. <div role="contentinfo">
  1681. <p>
  1682. &copy; Copyright 2016, Author.
  1683. </p>
  1684. </div>
  1685. 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>.
  1686. </footer>
  1687. </div>
  1688. </div>
  1689. </section>
  1690. </div>
  1691. <script type="text/javascript">
  1692. var DOCUMENTATION_OPTIONS = {
  1693. URL_ROOT:'./',
  1694. VERSION:'1.0.4',
  1695. COLLAPSE_INDEX:false,
  1696. FILE_SUFFIX:'.html',
  1697. HAS_SOURCE: true
  1698. };
  1699. </script>
  1700. <script type="text/javascript" src="_static/jquery.js"></script>
  1701. <script type="text/javascript" src="_static/underscore.js"></script>
  1702. <script type="text/javascript" src="_static/doctools.js"></script>
  1703. <script type="text/javascript" src="_static/js/theme.js"></script>
  1704. <script type="text/javascript">
  1705. jQuery(function () {
  1706. SphinxRtdTheme.StickyNav.enable();
  1707. });
  1708. </script>
  1709. </body>
  1710. </html>