grpc.beta.html 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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.beta package &mdash; grpcio 0.13.1rc1 documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <link rel="top" title="grpcio 0.13.1rc1 documentation" href="index.html"/>
  10. <link rel="up" title="grpc package" href="grpc.html"/>
  11. <link rel="next" title="grpc.early_adopter package" href="grpc.early_adopter.html"/>
  12. <link rel="prev" title="grpc package" href="grpc.html"/>
  13. <script src="_static/js/modernizr.min.js"></script>
  14. </head>
  15. <body class="wy-body-for-nav" role="document">
  16. <div class="wy-grid-for-nav">
  17. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  18. <div class="wy-side-scroll">
  19. <div class="wy-side-nav-search">
  20. <a href="index.html" class="icon icon-home"> grpcio
  21. </a>
  22. <div class="version">
  23. 0.13.1rc1
  24. </div>
  25. <div role="search">
  26. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  27. <input type="text" name="q" placeholder="Search docs" />
  28. <input type="hidden" name="check_keywords" value="yes" />
  29. <input type="hidden" name="area" value="default" />
  30. </form>
  31. </div>
  32. </div>
  33. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  34. <ul class="current">
  35. <li class="toctree-l1 current"><a class="reference internal" href="grpc.html">grpc package</a><ul class="current">
  36. <li class="toctree-l2 current"><a class="reference internal" href="grpc.html#subpackages">Subpackages</a><ul class="current">
  37. <li class="toctree-l3 current"><a class="current reference internal" href="">grpc.beta package</a><ul>
  38. <li class="toctree-l4"><a class="reference internal" href="#submodules">Submodules</a></li>
  39. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.implementations">grpc.beta.implementations module</a></li>
  40. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.interfaces">grpc.beta.interfaces module</a></li>
  41. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.utilities">grpc.beta.utilities module</a></li>
  42. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta">Module contents</a></li>
  43. </ul>
  44. </li>
  45. <li class="toctree-l3"><a class="reference internal" href="grpc.early_adopter.html">grpc.early_adopter package</a></li>
  46. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a></li>
  47. </ul>
  48. </li>
  49. <li class="toctree-l2"><a class="reference internal" href="grpc.html#module-grpc">Module contents</a></li>
  50. </ul>
  51. </li>
  52. </ul>
  53. </div>
  54. </div>
  55. </nav>
  56. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  57. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  58. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  59. <a href="index.html">grpcio</a>
  60. </nav>
  61. <div class="wy-nav-content">
  62. <div class="rst-content">
  63. <div role="navigation" aria-label="breadcrumbs navigation">
  64. <ul class="wy-breadcrumbs">
  65. <li><a href="index.html">Docs</a> &raquo;</li>
  66. <li><a href="grpc.html">grpc package</a> &raquo;</li>
  67. <li>grpc.beta package</li>
  68. <li class="wy-breadcrumbs-aside">
  69. <a href="_sources/grpc.beta.txt" rel="nofollow"> View page source</a>
  70. </li>
  71. </ul>
  72. <hr/>
  73. </div>
  74. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  75. <div itemprop="articleBody">
  76. <div class="section" id="grpc-beta-package">
  77. <h1>grpc.beta package<a class="headerlink" href="#grpc-beta-package" title="Permalink to this headline">¶</a></h1>
  78. <div class="section" id="submodules">
  79. <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
  80. </div>
  81. <div class="section" id="module-grpc.beta.implementations">
  82. <span id="grpc-beta-implementations-module"></span><h2>grpc.beta.implementations module<a class="headerlink" href="#module-grpc.beta.implementations" title="Permalink to this headline">¶</a></h2>
  83. <p>Entry points into the Beta API of gRPC Python.</p>
  84. <dl class="class">
  85. <dt id="grpc.beta.implementations.CallCredentials">
  86. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">CallCredentials</code><span class="sig-paren">(</span><em>low_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#CallCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.CallCredentials" title="Permalink to this definition">¶</a></dt>
  87. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  88. <p>A value encapsulating data asserting an identity over an <em>established</em>
  89. channel. May be composed with ChannelCredentials to always assert identity for
  90. every call over that channel.</p>
  91. <p>This class and its instances have no supported interface - it exists to define
  92. the type of its instances and its instances exist to be passed to other
  93. functions.</p>
  94. </dd></dl>
  95. <dl class="class">
  96. <dt id="grpc.beta.implementations.Channel">
  97. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">Channel</code><span class="sig-paren">(</span><em>low_channel</em>, <em>intermediary_low_channel</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#Channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel" title="Permalink to this definition">¶</a></dt>
  98. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  99. <p>A channel to a remote host through which RPCs may be conducted.</p>
  100. <p>Only the &#8220;subscribe&#8221; and &#8220;unsubscribe&#8221; methods are supported for application
  101. use. This class&#8217; instance constructor and all other attributes are
  102. unsupported.</p>
  103. <dl class="method">
  104. <dt id="grpc.beta.implementations.Channel.subscribe">
  105. <code class="descname">subscribe</code><span class="sig-paren">(</span><em>callback</em>, <em>try_to_connect=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#Channel.subscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel.subscribe" title="Permalink to this definition">¶</a></dt>
  106. <dd><p>Subscribes to this Channel&#8217;s connectivity.</p>
  107. <table class="docutils field-list" frame="void" rules="none">
  108. <col class="field-name" />
  109. <col class="field-body" />
  110. <tbody valign="top">
  111. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  112. <li><strong>callback</strong> &#8211; A callable to be invoked and passed an
  113. interfaces.ChannelConnectivity identifying this Channel&#8217;s connectivity.
  114. The callable will be invoked immediately upon subscription and again for
  115. every change to this Channel&#8217;s connectivity thereafter until it is
  116. unsubscribed.</li>
  117. <li><strong>try_to_connect</strong> &#8211; A boolean indicating whether or not this Channel should
  118. attempt to connect if it is not already connected and ready to conduct
  119. RPCs.</li>
  120. </ul>
  121. </td>
  122. </tr>
  123. </tbody>
  124. </table>
  125. </dd></dl>
  126. <dl class="method">
  127. <dt id="grpc.beta.implementations.Channel.unsubscribe">
  128. <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/beta/implementations.html#Channel.unsubscribe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.Channel.unsubscribe" title="Permalink to this definition">¶</a></dt>
  129. <dd><p>Unsubscribes a callback from this Channel&#8217;s connectivity.</p>
  130. <table class="docutils field-list" frame="void" rules="none">
  131. <col class="field-name" />
  132. <col class="field-body" />
  133. <tbody valign="top">
  134. <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
  135. been passed to its &#8220;subscribe&#8221; method.</td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. </dd></dl>
  140. </dd></dl>
  141. <dl class="class">
  142. <dt id="grpc.beta.implementations.ChannelCredentials">
  143. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">ChannelCredentials</code><span class="sig-paren">(</span><em>low_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#ChannelCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ChannelCredentials" title="Permalink to this definition">¶</a></dt>
  144. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  145. <p>A value encapsulating the data required to create a secure Channel.</p>
  146. <p>This class and its instances have no supported interface - it exists to define
  147. the type of its instances and its instances exist to be passed to other
  148. functions.</p>
  149. </dd></dl>
  150. <dl class="class">
  151. <dt id="grpc.beta.implementations.ServerCredentials">
  152. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">ServerCredentials</code><span class="sig-paren">(</span><em>low_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#ServerCredentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ServerCredentials" title="Permalink to this definition">¶</a></dt>
  153. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  154. <p>A value encapsulating the data required to open a secure port on a Server.</p>
  155. <p>This class and its instances have no supported interface - it exists to define
  156. the type of its instances and its instances exist to be passed to other
  157. functions.</p>
  158. </dd></dl>
  159. <dl class="class">
  160. <dt id="grpc.beta.implementations.ServerOptions">
  161. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">ServerOptions</code><span class="sig-paren">(</span><em>multi_method_implementation</em>, <em>request_deserializers</em>, <em>response_serializers</em>, <em>thread_pool</em>, <em>thread_pool_size</em>, <em>default_timeout</em>, <em>maximum_timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#ServerOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ServerOptions" title="Permalink to this definition">¶</a></dt>
  162. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  163. <p>A value encapsulating the various options for creation of a Server.</p>
  164. <p>This class and its instances have no supported interface - it exists to define
  165. the type of its instances and its instances exist to be passed to other
  166. functions.</p>
  167. </dd></dl>
  168. <dl class="class">
  169. <dt id="grpc.beta.implementations.StubOptions">
  170. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">StubOptions</code><span class="sig-paren">(</span><em>host</em>, <em>request_serializers</em>, <em>response_deserializers</em>, <em>metadata_transformer</em>, <em>thread_pool</em>, <em>thread_pool_size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#StubOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.StubOptions" title="Permalink to this definition">¶</a></dt>
  171. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  172. <p>A value encapsulating the various options for creation of a Stub.</p>
  173. <p>This class and its instances have no supported interface - it exists to define
  174. the type of its instances and its instances exist to be passed to other
  175. functions.</p>
  176. </dd></dl>
  177. <dl class="function">
  178. <dt id="grpc.beta.implementations.composite_call_credentials">
  179. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">composite_call_credentials</code><span class="sig-paren">(</span><em>call_credentials</em>, <em>additional_call_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#composite_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.composite_call_credentials" title="Permalink to this definition">¶</a></dt>
  180. <dd><p>Compose two CallCredentials to make a new one.</p>
  181. <table class="docutils field-list" frame="void" rules="none">
  182. <col class="field-name" />
  183. <col class="field-body" />
  184. <tbody valign="top">
  185. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  186. <li><strong>call_credentials</strong> &#8211; A CallCredentials object.</li>
  187. <li><strong>additional_call_credentials</strong> &#8211; Another CallCredentials object to compose on
  188. top of call_credentials.</li>
  189. </ul>
  190. </td>
  191. </tr>
  192. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A CallCredentials object for use in a GRPCCallOptions object.</p>
  193. </td>
  194. </tr>
  195. </tbody>
  196. </table>
  197. </dd></dl>
  198. <dl class="function">
  199. <dt id="grpc.beta.implementations.composite_channel_credentials">
  200. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">composite_channel_credentials</code><span class="sig-paren">(</span><em>channel_credentials</em>, <em>additional_call_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#composite_channel_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.composite_channel_credentials" title="Permalink to this definition">¶</a></dt>
  201. <dd><p>Compose ChannelCredentials on top of client credentials to make a new one.</p>
  202. <table class="docutils field-list" frame="void" rules="none">
  203. <col class="field-name" />
  204. <col class="field-body" />
  205. <tbody valign="top">
  206. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  207. <li><strong>channel_credentials</strong> &#8211; A ChannelCredentials object.</li>
  208. <li><strong>additional_call_credentials</strong> &#8211; A CallCredentials object to compose on
  209. top of channel_credentials.</li>
  210. </ul>
  211. </td>
  212. </tr>
  213. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A ChannelCredentials object for use in a GRPCCallOptions object.</p>
  214. </td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. </dd></dl>
  219. <dl class="function">
  220. <dt id="grpc.beta.implementations.dynamic_stub">
  221. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">dynamic_stub</code><span class="sig-paren">(</span><em>channel</em>, <em>service</em>, <em>cardinalities</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#dynamic_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.dynamic_stub" title="Permalink to this definition">¶</a></dt>
  222. <dd><p>Creates a face.DynamicStub with which RPCs can be invoked.</p>
  223. <table class="docutils field-list" frame="void" rules="none">
  224. <col class="field-name" />
  225. <col class="field-body" />
  226. <tbody valign="top">
  227. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  228. <li><strong>channel</strong> &#8211; A Channel for the returned face.DynamicStub to use.</li>
  229. <li><strong>service</strong> &#8211; The package-qualified full name of the service.</li>
  230. <li><strong>cardinalities</strong> &#8211; A dictionary from RPC method name to cardinality.Cardinality
  231. value identifying the cardinality of the RPC method.</li>
  232. <li><strong>options</strong> &#8211; An optional StubOptions value further customizing the functionality
  233. of the returned face.DynamicStub.</li>
  234. </ul>
  235. </td>
  236. </tr>
  237. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A face.DynamicStub with which RPCs can be invoked.</p>
  238. </td>
  239. </tr>
  240. </tbody>
  241. </table>
  242. </dd></dl>
  243. <dl class="function">
  244. <dt id="grpc.beta.implementations.generic_stub">
  245. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">generic_stub</code><span class="sig-paren">(</span><em>channel</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#generic_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.generic_stub" title="Permalink to this definition">¶</a></dt>
  246. <dd><p>Creates a face.GenericStub on which RPCs can be made.</p>
  247. <table class="docutils field-list" frame="void" rules="none">
  248. <col class="field-name" />
  249. <col class="field-body" />
  250. <tbody valign="top">
  251. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  252. <li><strong>channel</strong> &#8211; A Channel for use by the created stub.</li>
  253. <li><strong>options</strong> &#8211; A StubOptions customizing the created stub.</li>
  254. </ul>
  255. </td>
  256. </tr>
  257. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A face.GenericStub on which RPCs can be made.</p>
  258. </td>
  259. </tr>
  260. </tbody>
  261. </table>
  262. </dd></dl>
  263. <dl class="function">
  264. <dt id="grpc.beta.implementations.insecure_channel">
  265. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">insecure_channel</code><span class="sig-paren">(</span><em>host</em>, <em>port</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#insecure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.insecure_channel" title="Permalink to this definition">¶</a></dt>
  266. <dd><p>Creates an insecure Channel to a remote host.</p>
  267. <table class="docutils field-list" frame="void" rules="none">
  268. <col class="field-name" />
  269. <col class="field-body" />
  270. <tbody valign="top">
  271. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  272. <li><strong>host</strong> &#8211; The name of the remote host to which to connect.</li>
  273. <li><strong>port</strong> &#8211; The port of the remote host to which to connect.</li>
  274. </ul>
  275. </td>
  276. </tr>
  277. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Channel to the remote host through which RPCs may be conducted.</p>
  278. </td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. </dd></dl>
  283. <dl class="function">
  284. <dt id="grpc.beta.implementations.metadata_call_credentials">
  285. <code class="descclassname">grpc.beta.implementations.</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/beta/implementations.html#metadata_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.metadata_call_credentials" title="Permalink to this definition">¶</a></dt>
  286. <dd><p>Construct CallCredentials from an interfaces.GRPCAuthMetadataPlugin.</p>
  287. <table class="docutils field-list" frame="void" rules="none">
  288. <col class="field-name" />
  289. <col class="field-body" />
  290. <tbody valign="top">
  291. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata_plugin</strong> &#8211; An interfaces.GRPCAuthMetadataPlugin to use in constructing
  292. the CallCredentials object.</td>
  293. </tr>
  294. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A CallCredentials object for use in a GRPCCallOptions object.</td>
  295. </tr>
  296. </tbody>
  297. </table>
  298. </dd></dl>
  299. <dl class="function">
  300. <dt id="grpc.beta.implementations.secure_channel">
  301. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">secure_channel</code><span class="sig-paren">(</span><em>host</em>, <em>port</em>, <em>channel_credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#secure_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.secure_channel" title="Permalink to this definition">¶</a></dt>
  302. <dd><p>Creates a secure Channel to a remote host.</p>
  303. <table class="docutils field-list" frame="void" rules="none">
  304. <col class="field-name" />
  305. <col class="field-body" />
  306. <tbody valign="top">
  307. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  308. <li><strong>host</strong> &#8211; The name of the remote host to which to connect.</li>
  309. <li><strong>port</strong> &#8211; The port of the remote host to which to connect.</li>
  310. <li><strong>channel_credentials</strong> &#8211; A ChannelCredentials.</li>
  311. </ul>
  312. </td>
  313. </tr>
  314. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A secure Channel to the remote host through which RPCs may be conducted.</p>
  315. </td>
  316. </tr>
  317. </tbody>
  318. </table>
  319. </dd></dl>
  320. <dl class="function">
  321. <dt id="grpc.beta.implementations.server">
  322. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">server</code><span class="sig-paren">(</span><em>service_implementations</em>, <em>options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.server" title="Permalink to this definition">¶</a></dt>
  323. <dd><p>Creates an interfaces.Server with which RPCs can be serviced.</p>
  324. <table class="docutils field-list" frame="void" rules="none">
  325. <col class="field-name" />
  326. <col class="field-body" />
  327. <tbody valign="top">
  328. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  329. <li><strong>service_implementations</strong> &#8211; A dictionary from service name-method name pair to
  330. face.MethodImplementation.</li>
  331. <li><strong>options</strong> &#8211; An optional ServerOptions value further customizing the
  332. functionality of the returned Server.</li>
  333. </ul>
  334. </td>
  335. </tr>
  336. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.Server with which RPCs can be serviced.</p>
  337. </td>
  338. </tr>
  339. </tbody>
  340. </table>
  341. </dd></dl>
  342. <dl class="function">
  343. <dt id="grpc.beta.implementations.server_options">
  344. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">server_options</code><span class="sig-paren">(</span><em>multi_method_implementation=None</em>, <em>request_deserializers=None</em>, <em>response_serializers=None</em>, <em>thread_pool=None</em>, <em>thread_pool_size=None</em>, <em>default_timeout=None</em>, <em>maximum_timeout=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#server_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.server_options" title="Permalink to this definition">¶</a></dt>
  345. <dd><p>Creates a ServerOptions value to be passed at server creation.</p>
  346. <p>All parameters are optional and should always be passed by keyword.</p>
  347. <table class="docutils field-list" frame="void" rules="none">
  348. <col class="field-name" />
  349. <col class="field-body" />
  350. <tbody valign="top">
  351. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  352. <li><strong>multi_method_implementation</strong> &#8211; A face.MultiMethodImplementation to be called
  353. to service an RPC if the server has no specific method implementation for
  354. the name of the RPC for which service was requested.</li>
  355. <li><strong>request_deserializers</strong> &#8211; A dictionary from service name-method name pair to
  356. request deserialization behavior.</li>
  357. <li><strong>response_serializers</strong> &#8211; A dictionary from service name-method name pair to
  358. response serialization behavior.</li>
  359. <li><strong>thread_pool</strong> &#8211; A thread pool to use in stubs.</li>
  360. <li><strong>thread_pool_size</strong> &#8211; The size of thread pool to create for use in stubs;
  361. ignored if thread_pool has been passed.</li>
  362. <li><strong>default_timeout</strong> &#8211; A duration in seconds to allow for RPC service when
  363. servicing RPCs that did not include a timeout value when invoked.</li>
  364. <li><strong>maximum_timeout</strong> &#8211; A duration in seconds to allow for RPC service when
  365. servicing RPCs no matter what timeout value was passed when the RPC was
  366. invoked.</li>
  367. </ul>
  368. </td>
  369. </tr>
  370. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StubOptions value created from the passed parameters.</p>
  371. </td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. </dd></dl>
  376. <dl class="function">
  377. <dt id="grpc.beta.implementations.ssl_channel_credentials">
  378. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">ssl_channel_credentials</code><span class="sig-paren">(</span><em>root_certificates</em>, <em>private_key</em>, <em>certificate_chain</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#ssl_channel_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ssl_channel_credentials" title="Permalink to this definition">¶</a></dt>
  379. <dd><p>Creates a ChannelCredentials for use with an SSL-enabled Channel.</p>
  380. <table class="docutils field-list" frame="void" rules="none">
  381. <col class="field-name" />
  382. <col class="field-body" />
  383. <tbody valign="top">
  384. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  385. <li><strong>root_certificates</strong> &#8211; The PEM-encoded root certificates or None to ask for
  386. them to be retrieved from a default location.</li>
  387. <li><strong>private_key</strong> &#8211; The PEM-encoded private key to use or None if no private key
  388. should be used.</li>
  389. <li><strong>certificate_chain</strong> &#8211; The PEM-encoded certificate chain to use or None if no
  390. certificate chain should be used.</li>
  391. </ul>
  392. </td>
  393. </tr>
  394. <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>
  395. </td>
  396. </tr>
  397. </tbody>
  398. </table>
  399. </dd></dl>
  400. <dl class="function">
  401. <dt id="grpc.beta.implementations.ssl_server_credentials">
  402. <code class="descclassname">grpc.beta.implementations.</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/beta/implementations.html#ssl_server_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.ssl_server_credentials" title="Permalink to this definition">¶</a></dt>
  403. <dd><p>Creates a ServerCredentials for use with an SSL-enabled Server.</p>
  404. <table class="docutils field-list" frame="void" rules="none">
  405. <col class="field-name" />
  406. <col class="field-body" />
  407. <tbody valign="top">
  408. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  409. <li><strong>private_key_certificate_chain_pairs</strong> &#8211; A nonempty sequence each element of
  410. which is a pair the first element of which is a PEM-encoded private key
  411. and the second element of which is the corresponding PEM-encoded
  412. certificate chain.</li>
  413. <li><strong>root_certificates</strong> &#8211; PEM-encoded client root certificates to be used for
  414. verifying authenticated clients. If omitted, require_client_auth must also
  415. be omitted or be False.</li>
  416. <li><strong>require_client_auth</strong> &#8211; A boolean indicating whether or not to require clients
  417. to be authenticated. May only be True if root_certificates is not None.</li>
  418. </ul>
  419. </td>
  420. </tr>
  421. <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>
  422. </td>
  423. </tr>
  424. </tbody>
  425. </table>
  426. </dd></dl>
  427. <dl class="function">
  428. <dt id="grpc.beta.implementations.stub_options">
  429. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">stub_options</code><span class="sig-paren">(</span><em>host=None</em>, <em>request_serializers=None</em>, <em>response_deserializers=None</em>, <em>metadata_transformer=None</em>, <em>thread_pool=None</em>, <em>thread_pool_size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#stub_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.stub_options" title="Permalink to this definition">¶</a></dt>
  430. <dd><p>Creates a StubOptions value to be passed at stub creation.</p>
  431. <p>All parameters are optional and should always be passed by keyword.</p>
  432. <table class="docutils field-list" frame="void" rules="none">
  433. <col class="field-name" />
  434. <col class="field-body" />
  435. <tbody valign="top">
  436. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  437. <li><strong>host</strong> &#8211; A host string to set on RPC calls.</li>
  438. <li><strong>request_serializers</strong> &#8211; A dictionary from service name-method name pair to
  439. request serialization behavior.</li>
  440. <li><strong>response_deserializers</strong> &#8211; A dictionary from service name-method name pair to
  441. response deserialization behavior.</li>
  442. <li><strong>metadata_transformer</strong> &#8211; A callable that given a metadata object produces
  443. another metadata object to be used in the underlying communication on the
  444. wire.</li>
  445. <li><strong>thread_pool</strong> &#8211; A thread pool to use in stubs.</li>
  446. <li><strong>thread_pool_size</strong> &#8211; The size of thread pool to create for use in stubs;
  447. ignored if thread_pool has been passed.</li>
  448. </ul>
  449. </td>
  450. </tr>
  451. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A StubOptions value created from the passed parameters.</p>
  452. </td>
  453. </tr>
  454. </tbody>
  455. </table>
  456. </dd></dl>
  457. </div>
  458. <div class="section" id="module-grpc.beta.interfaces">
  459. <span id="grpc-beta-interfaces-module"></span><h2>grpc.beta.interfaces module<a class="headerlink" href="#module-grpc.beta.interfaces" title="Permalink to this headline">¶</a></h2>
  460. <p>Constants and interfaces of the Beta API of gRPC Python.</p>
  461. <dl class="class">
  462. <dt id="grpc.beta.interfaces.ChannelConnectivity">
  463. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">ChannelConnectivity</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#ChannelConnectivity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity" title="Permalink to this definition">¶</a></dt>
  464. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  465. <p>Mirrors grpc_connectivity_state in the gRPC Core.</p>
  466. <dl class="attribute">
  467. <dt id="grpc.beta.interfaces.ChannelConnectivity.IDLE">
  468. <code class="descname">IDLE</code><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity.IDLE" title="Permalink to this definition">¶</a></dt>
  469. <dd><p>The channel is idle.</p>
  470. </dd></dl>
  471. <dl class="attribute">
  472. <dt id="grpc.beta.interfaces.ChannelConnectivity.CONNECTING">
  473. <code class="descname">CONNECTING</code><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity.CONNECTING" title="Permalink to this definition">¶</a></dt>
  474. <dd><p>The channel is connecting.</p>
  475. </dd></dl>
  476. <dl class="attribute">
  477. <dt id="grpc.beta.interfaces.ChannelConnectivity.READY">
  478. <code class="descname">READY</code><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity.READY" title="Permalink to this definition">¶</a></dt>
  479. <dd><p>The channel is ready to conduct RPCs.</p>
  480. </dd></dl>
  481. <dl class="attribute">
  482. <dt id="grpc.beta.interfaces.ChannelConnectivity.TRANSIENT_FAILURE">
  483. <code class="descname">TRANSIENT_FAILURE</code><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity.TRANSIENT_FAILURE" title="Permalink to this definition">¶</a></dt>
  484. <dd><p>The channel has seen a failure from which it expects to
  485. recover.</p>
  486. </dd></dl>
  487. <dl class="attribute">
  488. <dt id="grpc.beta.interfaces.ChannelConnectivity.FATAL_FAILURE">
  489. <code class="descname">FATAL_FAILURE</code><a class="headerlink" href="#grpc.beta.interfaces.ChannelConnectivity.FATAL_FAILURE" title="Permalink to this definition">¶</a></dt>
  490. <dd><p>The channel has seen a failure from which it cannot recover.</p>
  491. </dd></dl>
  492. <dl class="attribute">
  493. <dt>
  494. <code class="descname">CONNECTING</code><em class="property"> = &lt;ChannelConnectivity.CONNECTING: (&lt;ConnectivityState.CONNECTING: 1&gt;, 'connecting')&gt;</em></dt>
  495. <dd></dd></dl>
  496. <dl class="attribute">
  497. <dt>
  498. <code class="descname">FATAL_FAILURE</code><em class="property"> = &lt;ChannelConnectivity.FATAL_FAILURE: (&lt;ConnectivityState.FATAL_FAILURE: 4&gt;, 'fatal failure')&gt;</em></dt>
  499. <dd></dd></dl>
  500. <dl class="attribute">
  501. <dt>
  502. <code class="descname">IDLE</code><em class="property"> = &lt;ChannelConnectivity.IDLE: (&lt;ConnectivityState.IDLE: 0&gt;, 'idle')&gt;</em></dt>
  503. <dd></dd></dl>
  504. <dl class="attribute">
  505. <dt>
  506. <code class="descname">READY</code><em class="property"> = &lt;ChannelConnectivity.READY: (&lt;ConnectivityState.READY: 2&gt;, 'ready')&gt;</em></dt>
  507. <dd></dd></dl>
  508. <dl class="attribute">
  509. <dt>
  510. <code class="descname">TRANSIENT_FAILURE</code><em class="property"> = &lt;ChannelConnectivity.TRANSIENT_FAILURE: (&lt;ConnectivityState.TRANSIENT_FAILURE: 3&gt;, 'transient failure')&gt;</em></dt>
  511. <dd></dd></dl>
  512. </dd></dl>
  513. <dl class="class">
  514. <dt id="grpc.beta.interfaces.GRPCAuthMetadataContext">
  515. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCAuthMetadataContext</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCAuthMetadataContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCAuthMetadataContext" title="Permalink to this definition">¶</a></dt>
  516. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  517. <p>Provides information to call credentials metadata plugins.</p>
  518. <dl class="attribute">
  519. <dt id="grpc.beta.interfaces.GRPCAuthMetadataContext.service_url">
  520. <code class="descname">service_url</code><a class="headerlink" href="#grpc.beta.interfaces.GRPCAuthMetadataContext.service_url" title="Permalink to this definition">¶</a></dt>
  521. <dd><p>A string URL of the service being called into.</p>
  522. </dd></dl>
  523. <dl class="attribute">
  524. <dt id="grpc.beta.interfaces.GRPCAuthMetadataContext.method_name">
  525. <code class="descname">method_name</code><a class="headerlink" href="#grpc.beta.interfaces.GRPCAuthMetadataContext.method_name" title="Permalink to this definition">¶</a></dt>
  526. <dd><p>A string of the fully qualified method name being called.</p>
  527. </dd></dl>
  528. </dd></dl>
  529. <dl class="class">
  530. <dt id="grpc.beta.interfaces.GRPCAuthMetadataPlugin">
  531. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCAuthMetadataPlugin</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCAuthMetadataPlugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCAuthMetadataPlugin" title="Permalink to this definition">¶</a></dt>
  532. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  533. </dd></dl>
  534. <dl class="class">
  535. <dt id="grpc.beta.interfaces.GRPCAuthMetadataPluginCallback">
  536. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCAuthMetadataPluginCallback</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCAuthMetadataPluginCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCAuthMetadataPluginCallback" title="Permalink to this definition">¶</a></dt>
  537. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  538. <p>Callback object received by a metadata plugin.</p>
  539. </dd></dl>
  540. <dl class="class">
  541. <dt id="grpc.beta.interfaces.GRPCCallOptions">
  542. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCCallOptions</code><span class="sig-paren">(</span><em>disable_compression</em>, <em>subcall_of</em>, <em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCCallOptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCCallOptions" title="Permalink to this definition">¶</a></dt>
  543. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  544. <p>A value encapsulating gRPC-specific options passed on RPC invocation.</p>
  545. <p>This class and its instances have no supported interface - it exists to
  546. define the type of its instances and its instances exist to be passed to
  547. other functions.</p>
  548. </dd></dl>
  549. <dl class="class">
  550. <dt id="grpc.beta.interfaces.GRPCInvocationContext">
  551. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCInvocationContext</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCInvocationContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCInvocationContext" title="Permalink to this definition">¶</a></dt>
  552. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  553. <p>Exposes gRPC-specific options and behaviors to code invoking RPCs.</p>
  554. <dl class="method">
  555. <dt id="grpc.beta.interfaces.GRPCInvocationContext.disable_next_request_compression">
  556. <code class="descname">disable_next_request_compression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCInvocationContext.disable_next_request_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCInvocationContext.disable_next_request_compression" title="Permalink to this definition">¶</a></dt>
  557. <dd><p>Disables compression of the next request passed by the application.</p>
  558. </dd></dl>
  559. </dd></dl>
  560. <dl class="class">
  561. <dt id="grpc.beta.interfaces.GRPCServicerContext">
  562. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">GRPCServicerContext</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext" title="Permalink to this definition">¶</a></dt>
  563. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  564. <p>Exposes gRPC-specific options and behaviors to code servicing RPCs.</p>
  565. <dl class="method">
  566. <dt id="grpc.beta.interfaces.GRPCServicerContext.disable_next_response_compression">
  567. <code class="descname">disable_next_response_compression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext.disable_next_response_compression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext.disable_next_response_compression" title="Permalink to this definition">¶</a></dt>
  568. <dd><p>Disables compression of the next response passed by the application.</p>
  569. </dd></dl>
  570. <dl class="method">
  571. <dt id="grpc.beta.interfaces.GRPCServicerContext.peer">
  572. <code class="descname">peer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#GRPCServicerContext.peer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.GRPCServicerContext.peer" title="Permalink to this definition">¶</a></dt>
  573. <dd><p>Identifies the peer that invoked the RPC being serviced.</p>
  574. <table class="docutils field-list" frame="void" rules="none">
  575. <col class="field-name" />
  576. <col class="field-body" />
  577. <tbody valign="top">
  578. <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>
  579. </tr>
  580. </tbody>
  581. </table>
  582. </dd></dl>
  583. </dd></dl>
  584. <dl class="class">
  585. <dt id="grpc.beta.interfaces.Server">
  586. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">Server</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server" title="Permalink to this definition">¶</a></dt>
  587. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  588. <p>Services RPCs.</p>
  589. <dl class="method">
  590. <dt id="grpc.beta.interfaces.Server.add_insecure_port">
  591. <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/beta/interfaces.html#Server.add_insecure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.add_insecure_port" title="Permalink to this definition">¶</a></dt>
  592. <dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p>
  593. <p>This method may only be called before calling this Server&#8217;s start method is
  594. called.</p>
  595. <table class="docutils field-list" frame="void" rules="none">
  596. <col class="field-name" />
  597. <col class="field-body" />
  598. <tbody valign="top">
  599. <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>
  600. </tr>
  601. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  602. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  603. <dd>started. This is typically the same number as the port number contained
  604. in the passed address, but will likely be different if the port number
  605. contained in the passed address was zero.</dd>
  606. </dl>
  607. </td>
  608. </tr>
  609. </tbody>
  610. </table>
  611. </dd></dl>
  612. <dl class="method">
  613. <dt id="grpc.beta.interfaces.Server.add_secure_port">
  614. <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/beta/interfaces.html#Server.add_secure_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.add_secure_port" title="Permalink to this definition">¶</a></dt>
  615. <dd><p>Reserves a port for secure RPC service after this Server becomes active.</p>
  616. <p>This method may only be called before calling this Server&#8217;s start method is
  617. called.</p>
  618. <table class="docutils field-list" frame="void" rules="none">
  619. <col class="field-name" />
  620. <col class="field-body" />
  621. <tbody valign="top">
  622. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  623. <li><strong>address</strong> &#8211; The address for which to open a port.</li>
  624. <li><strong>server_credentials</strong> &#8211; A ServerCredentials.</li>
  625. </ul>
  626. </td>
  627. </tr>
  628. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  629. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  630. <dd><p class="first last">started. This is typically the same number as the port number contained
  631. in the passed address, but will likely be different if the port number
  632. contained in the passed address was zero.</p>
  633. </dd>
  634. </dl>
  635. </p>
  636. </td>
  637. </tr>
  638. </tbody>
  639. </table>
  640. </dd></dl>
  641. <dl class="method">
  642. <dt id="grpc.beta.interfaces.Server.start">
  643. <code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#Server.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.start" title="Permalink to this definition">¶</a></dt>
  644. <dd><p>Starts this Server&#8217;s service of RPCs.</p>
  645. <p>This method may only be called while the server is not serving RPCs (i.e. it
  646. is not idempotent).</p>
  647. </dd></dl>
  648. <dl class="method">
  649. <dt id="grpc.beta.interfaces.Server.stop">
  650. <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/beta/interfaces.html#Server.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.Server.stop" title="Permalink to this definition">¶</a></dt>
  651. <dd><p>Stops this Server&#8217;s service of RPCs.</p>
  652. <p>All calls to this method immediately stop service of new RPCs. When existing
  653. RPCs are aborted is controlled by the grace period parameter passed to this
  654. method.</p>
  655. <p>This method may be called at any time and is idempotent. Passing a smaller
  656. grace value than has been passed in a previous call will have the effect of
  657. stopping the Server sooner. Passing a larger grace value than has been
  658. passed in a previous call will not have the effect of stopping the sooner
  659. later.</p>
  660. <table class="docutils field-list" frame="void" rules="none">
  661. <col class="field-name" />
  662. <col class="field-body" />
  663. <tbody valign="top">
  664. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>grace</strong> &#8211; A duration of time in seconds to allow existing RPCs to complete
  665. before being aborted by this Server&#8217;s stopping. May be zero for
  666. immediate abortion of all in-progress RPCs.</td>
  667. </tr>
  668. <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
  669. stopped. The returned event may not be set until after the full grace
  670. period (if some ongoing RPC continues for the full length of the period)
  671. of it may be set much sooner (such as if this Server had no RPCs underway
  672. at the time it was stopped or if all RPCs that it had underway completed
  673. very early in the grace period).</td>
  674. </tr>
  675. </tbody>
  676. </table>
  677. </dd></dl>
  678. </dd></dl>
  679. <dl class="class">
  680. <dt id="grpc.beta.interfaces.StatusCode">
  681. <em class="property">class </em><code class="descclassname">grpc.beta.interfaces.</code><code class="descname">StatusCode</code><a class="reference internal" href="_modules/grpc/beta/interfaces.html#StatusCode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.StatusCode" title="Permalink to this definition">¶</a></dt>
  682. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  683. <p>Mirrors grpc_status_code in the C core.</p>
  684. <dl class="attribute">
  685. <dt id="grpc.beta.interfaces.StatusCode.ABORTED">
  686. <code class="descname">ABORTED</code><em class="property"> = &lt;StatusCode.ABORTED: 10&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.ABORTED" title="Permalink to this definition">¶</a></dt>
  687. <dd></dd></dl>
  688. <dl class="attribute">
  689. <dt id="grpc.beta.interfaces.StatusCode.ALREADY_EXISTS">
  690. <code class="descname">ALREADY_EXISTS</code><em class="property"> = &lt;StatusCode.ALREADY_EXISTS: 6&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.ALREADY_EXISTS" title="Permalink to this definition">¶</a></dt>
  691. <dd></dd></dl>
  692. <dl class="attribute">
  693. <dt id="grpc.beta.interfaces.StatusCode.CANCELLED">
  694. <code class="descname">CANCELLED</code><em class="property"> = &lt;StatusCode.CANCELLED: 1&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.CANCELLED" title="Permalink to this definition">¶</a></dt>
  695. <dd></dd></dl>
  696. <dl class="attribute">
  697. <dt id="grpc.beta.interfaces.StatusCode.DATA_LOSS">
  698. <code class="descname">DATA_LOSS</code><em class="property"> = &lt;StatusCode.DATA_LOSS: 15&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.DATA_LOSS" title="Permalink to this definition">¶</a></dt>
  699. <dd></dd></dl>
  700. <dl class="attribute">
  701. <dt id="grpc.beta.interfaces.StatusCode.DEADLINE_EXCEEDED">
  702. <code class="descname">DEADLINE_EXCEEDED</code><em class="property"> = &lt;StatusCode.DEADLINE_EXCEEDED: 4&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.DEADLINE_EXCEEDED" title="Permalink to this definition">¶</a></dt>
  703. <dd></dd></dl>
  704. <dl class="attribute">
  705. <dt id="grpc.beta.interfaces.StatusCode.FAILED_PRECONDITION">
  706. <code class="descname">FAILED_PRECONDITION</code><em class="property"> = &lt;StatusCode.FAILED_PRECONDITION: 9&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.FAILED_PRECONDITION" title="Permalink to this definition">¶</a></dt>
  707. <dd></dd></dl>
  708. <dl class="attribute">
  709. <dt id="grpc.beta.interfaces.StatusCode.INTERNAL">
  710. <code class="descname">INTERNAL</code><em class="property"> = &lt;StatusCode.INTERNAL: 13&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.INTERNAL" title="Permalink to this definition">¶</a></dt>
  711. <dd></dd></dl>
  712. <dl class="attribute">
  713. <dt id="grpc.beta.interfaces.StatusCode.INVALID_ARGUMENT">
  714. <code class="descname">INVALID_ARGUMENT</code><em class="property"> = &lt;StatusCode.INVALID_ARGUMENT: 3&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.INVALID_ARGUMENT" title="Permalink to this definition">¶</a></dt>
  715. <dd></dd></dl>
  716. <dl class="attribute">
  717. <dt id="grpc.beta.interfaces.StatusCode.NOT_FOUND">
  718. <code class="descname">NOT_FOUND</code><em class="property"> = &lt;StatusCode.NOT_FOUND: 5&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.NOT_FOUND" title="Permalink to this definition">¶</a></dt>
  719. <dd></dd></dl>
  720. <dl class="attribute">
  721. <dt id="grpc.beta.interfaces.StatusCode.OK">
  722. <code class="descname">OK</code><em class="property"> = &lt;StatusCode.OK: 0&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.OK" title="Permalink to this definition">¶</a></dt>
  723. <dd></dd></dl>
  724. <dl class="attribute">
  725. <dt id="grpc.beta.interfaces.StatusCode.OUT_OF_RANGE">
  726. <code class="descname">OUT_OF_RANGE</code><em class="property"> = &lt;StatusCode.OUT_OF_RANGE: 11&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.OUT_OF_RANGE" title="Permalink to this definition">¶</a></dt>
  727. <dd></dd></dl>
  728. <dl class="attribute">
  729. <dt id="grpc.beta.interfaces.StatusCode.PERMISSION_DENIED">
  730. <code class="descname">PERMISSION_DENIED</code><em class="property"> = &lt;StatusCode.PERMISSION_DENIED: 7&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.PERMISSION_DENIED" title="Permalink to this definition">¶</a></dt>
  731. <dd></dd></dl>
  732. <dl class="attribute">
  733. <dt id="grpc.beta.interfaces.StatusCode.RESOURCE_EXHAUSTED">
  734. <code class="descname">RESOURCE_EXHAUSTED</code><em class="property"> = &lt;StatusCode.RESOURCE_EXHAUSTED: 8&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.RESOURCE_EXHAUSTED" title="Permalink to this definition">¶</a></dt>
  735. <dd></dd></dl>
  736. <dl class="attribute">
  737. <dt id="grpc.beta.interfaces.StatusCode.UNAUTHENTICATED">
  738. <code class="descname">UNAUTHENTICATED</code><em class="property"> = &lt;StatusCode.UNAUTHENTICATED: 16&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.UNAUTHENTICATED" title="Permalink to this definition">¶</a></dt>
  739. <dd></dd></dl>
  740. <dl class="attribute">
  741. <dt id="grpc.beta.interfaces.StatusCode.UNAVAILABLE">
  742. <code class="descname">UNAVAILABLE</code><em class="property"> = &lt;StatusCode.UNAVAILABLE: 14&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.UNAVAILABLE" title="Permalink to this definition">¶</a></dt>
  743. <dd></dd></dl>
  744. <dl class="attribute">
  745. <dt id="grpc.beta.interfaces.StatusCode.UNIMPLEMENTED">
  746. <code class="descname">UNIMPLEMENTED</code><em class="property"> = &lt;StatusCode.UNIMPLEMENTED: 12&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.UNIMPLEMENTED" title="Permalink to this definition">¶</a></dt>
  747. <dd></dd></dl>
  748. <dl class="attribute">
  749. <dt id="grpc.beta.interfaces.StatusCode.UNKNOWN">
  750. <code class="descname">UNKNOWN</code><em class="property"> = &lt;StatusCode.UNKNOWN: 2&gt;</em><a class="headerlink" href="#grpc.beta.interfaces.StatusCode.UNKNOWN" title="Permalink to this definition">¶</a></dt>
  751. <dd></dd></dl>
  752. </dd></dl>
  753. <dl class="function">
  754. <dt id="grpc.beta.interfaces.grpc_call_options">
  755. <code class="descclassname">grpc.beta.interfaces.</code><code class="descname">grpc_call_options</code><span class="sig-paren">(</span><em>disable_compression=False</em>, <em>credentials=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/interfaces.html#grpc_call_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.interfaces.grpc_call_options" title="Permalink to this definition">¶</a></dt>
  756. <dd><p>Creates a GRPCCallOptions value to be passed at RPC invocation.</p>
  757. <p>All parameters are optional and should always be passed by keyword.</p>
  758. <table class="docutils field-list" frame="void" rules="none">
  759. <col class="field-name" />
  760. <col class="field-body" />
  761. <tbody valign="top">
  762. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  763. <li><strong>disable_compression</strong> &#8211; A boolean indicating whether or not compression should
  764. be disabled for the request object of the RPC. Only valid for
  765. request-unary RPCs.</li>
  766. <li><strong>credentials</strong> &#8211; A CallCredentials object to use for the invoked RPC.</li>
  767. </ul>
  768. </td>
  769. </tr>
  770. </tbody>
  771. </table>
  772. </dd></dl>
  773. </div>
  774. <div class="section" id="module-grpc.beta.utilities">
  775. <span id="grpc-beta-utilities-module"></span><h2>grpc.beta.utilities module<a class="headerlink" href="#module-grpc.beta.utilities" title="Permalink to this headline">¶</a></h2>
  776. <p>Utilities for the gRPC Python Beta API.</p>
  777. <dl class="function">
  778. <dt id="grpc.beta.utilities.channel_ready_future">
  779. <code class="descclassname">grpc.beta.utilities.</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/beta/utilities.html#channel_ready_future"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.utilities.channel_ready_future" title="Permalink to this definition">¶</a></dt>
  780. <dd><p>Creates a future.Future tracking when an implementations.Channel is ready.</p>
  781. <p>Cancelling the returned future.Future does not tell the given
  782. implementations.Channel to abandon attempts it may have been making to
  783. connect; cancelling merely deactivates the return future.Future&#8217;s
  784. subscription to the given implementations.Channel&#8217;s connectivity.</p>
  785. <table class="docutils field-list" frame="void" rules="none">
  786. <col class="field-name" />
  787. <col class="field-body" />
  788. <tbody valign="top">
  789. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> &#8211; An implementations.Channel.</td>
  790. </tr>
  791. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  792. <dt>A future.Future that matures when the given Channel has connectivity</dt>
  793. <dd>interfaces.ChannelConnectivity.READY.</dd>
  794. </dl>
  795. </td>
  796. </tr>
  797. </tbody>
  798. </table>
  799. </dd></dl>
  800. </div>
  801. <div class="section" id="module-grpc.beta">
  802. <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc.beta" title="Permalink to this headline">¶</a></h2>
  803. </div>
  804. </div>
  805. </div>
  806. </div>
  807. <footer>
  808. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  809. <a href="grpc.early_adopter.html" class="btn btn-neutral float-right" title="grpc.early_adopter package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
  810. <a href="grpc.html" class="btn btn-neutral" title="grpc package" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  811. </div>
  812. <hr/>
  813. <div role="contentinfo">
  814. <p>
  815. &copy; Copyright 2016, Author.
  816. </p>
  817. </div>
  818. 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>.
  819. </footer>
  820. </div>
  821. </div>
  822. </section>
  823. </div>
  824. <script type="text/javascript">
  825. var DOCUMENTATION_OPTIONS = {
  826. URL_ROOT:'./',
  827. VERSION:'0.13.1rc1',
  828. COLLAPSE_INDEX:false,
  829. FILE_SUFFIX:'.html',
  830. HAS_SOURCE: true
  831. };
  832. </script>
  833. <script type="text/javascript" src="_static/jquery.js"></script>
  834. <script type="text/javascript" src="_static/underscore.js"></script>
  835. <script type="text/javascript" src="_static/doctools.js"></script>
  836. <script type="text/javascript" src="_static/js/theme.js"></script>
  837. <script type="text/javascript">
  838. jQuery(function () {
  839. SphinxRtdTheme.StickyNav.enable();
  840. });
  841. </script>
  842. </body>
  843. </html>