grpc.beta.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  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 1.2.0 documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <link rel="index" title="Index"
  10. href="genindex.html"/>
  11. <link rel="search" title="Search" href="search.html"/>
  12. <link rel="top" title="grpcio 1.2.0 documentation" href="index.html"/>
  13. <link rel="up" title="grpc package" href="grpc.html"/>
  14. <link rel="next" title="grpc.framework package" href="grpc.framework.html"/>
  15. <link rel="prev" title="grpc package" href="grpc.html"/>
  16. <script src="_static/js/modernizr.min.js"></script>
  17. </head>
  18. <body class="wy-body-for-nav" role="document">
  19. <div class="wy-grid-for-nav">
  20. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  21. <div class="wy-side-scroll">
  22. <div class="wy-side-nav-search">
  23. <a href="index.html" class="icon icon-home"> grpcio
  24. </a>
  25. <div class="version">
  26. 1.2.0
  27. </div>
  28. <div role="search">
  29. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  30. <input type="text" name="q" placeholder="Search docs" />
  31. <input type="hidden" name="check_keywords" value="yes" />
  32. <input type="hidden" name="area" value="default" />
  33. </form>
  34. </div>
  35. </div>
  36. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  37. <p class="caption"><span class="caption-text">Contents:</span></p>
  38. <ul class="current">
  39. <li class="toctree-l1 current"><a class="reference internal" href="grpc.html">grpc package</a><ul class="current">
  40. <li class="toctree-l2 current"><a class="reference internal" href="grpc.html#subpackages">Subpackages</a><ul class="current">
  41. <li class="toctree-l3 current"><a class="current reference internal" href="#">grpc.beta package</a><ul>
  42. <li class="toctree-l4"><a class="reference internal" href="#submodules">Submodules</a></li>
  43. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.implementations">grpc.beta.implementations module</a></li>
  44. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.interfaces">grpc.beta.interfaces module</a></li>
  45. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta.utilities">grpc.beta.utilities module</a></li>
  46. <li class="toctree-l4"><a class="reference internal" href="#module-grpc.beta">Module contents</a></li>
  47. </ul>
  48. </li>
  49. <li class="toctree-l3"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a></li>
  50. </ul>
  51. </li>
  52. <li class="toctree-l2"><a class="reference internal" href="grpc.html#module-grpc">Module contents</a></li>
  53. </ul>
  54. </li>
  55. <li class="toctree-l1"><a class="reference internal" href="grpc.html#glossary">Glossary</a></li>
  56. </ul>
  57. </div>
  58. </div>
  59. </nav>
  60. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  61. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  62. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  63. <a href="index.html">grpcio</a>
  64. </nav>
  65. <div class="wy-nav-content">
  66. <div class="rst-content">
  67. <div role="navigation" aria-label="breadcrumbs navigation">
  68. <ul class="wy-breadcrumbs">
  69. <li><a href="index.html">Docs</a> &raquo;</li>
  70. <li><a href="grpc.html">grpc package</a> &raquo;</li>
  71. <li>grpc.beta package</li>
  72. <li class="wy-breadcrumbs-aside">
  73. <a href="_sources/grpc.beta.rst.txt" rel="nofollow"> View page source</a>
  74. </li>
  75. </ul>
  76. <hr/>
  77. </div>
  78. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  79. <div itemprop="articleBody">
  80. <div class="section" id="grpc-beta-package">
  81. <h1>grpc.beta package<a class="headerlink" href="#grpc-beta-package" title="Permalink to this headline">¶</a></h1>
  82. <div class="section" id="submodules">
  83. <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
  84. </div>
  85. <div class="section" id="module-grpc.beta.implementations">
  86. <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>
  87. <p>Entry points into the Beta API of gRPC Python.</p>
  88. <dl class="class">
  89. <dt id="grpc.beta.implementations.Channel">
  90. <em class="property">class </em><code class="descclassname">grpc.beta.implementations.</code><code class="descname">Channel</code><span class="sig-paren">(</span><em>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>
  91. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  92. <p>A channel to a remote host through which RPCs may be conducted.</p>
  93. <p>Only the &#8220;subscribe&#8221; and &#8220;unsubscribe&#8221; methods are supported for application
  94. use. This class&#8217; instance constructor and all other attributes are
  95. unsupported.</p>
  96. <dl class="method">
  97. <dt id="grpc.beta.implementations.Channel.subscribe">
  98. <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>
  99. <dd><p>Subscribes to this Channel&#8217;s connectivity.</p>
  100. <table class="docutils field-list" frame="void" rules="none">
  101. <col class="field-name" />
  102. <col class="field-body" />
  103. <tbody valign="top">
  104. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  105. <li><strong>callback</strong> &#8211; A callable to be invoked and passed an
  106. interfaces.ChannelConnectivity identifying this Channel&#8217;s connectivity.
  107. The callable will be invoked immediately upon subscription and again for
  108. every change to this Channel&#8217;s connectivity thereafter until it is
  109. unsubscribed.</li>
  110. <li><strong>try_to_connect</strong> &#8211; A boolean indicating whether or not this Channel should
  111. attempt to connect if it is not already connected and ready to conduct
  112. RPCs.</li>
  113. </ul>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </dd></dl>
  119. <dl class="method">
  120. <dt id="grpc.beta.implementations.Channel.unsubscribe">
  121. <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>
  122. <dd><p>Unsubscribes a callback from this Channel&#8217;s connectivity.</p>
  123. <table class="docutils field-list" frame="void" rules="none">
  124. <col class="field-name" />
  125. <col class="field-body" />
  126. <tbody valign="top">
  127. <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
  128. been passed to its &#8220;subscribe&#8221; method.</td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. </dd></dl>
  133. </dd></dl>
  134. <dl class="class">
  135. <dt id="grpc.beta.implementations.ServerOptions">
  136. <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>
  137. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  138. <p>A value encapsulating the various options for creation of a Server.</p>
  139. <p>This class and its instances have no supported interface - it exists to define
  140. the type of its instances and its instances exist to be passed to other
  141. functions.</p>
  142. </dd></dl>
  143. <dl class="class">
  144. <dt id="grpc.beta.implementations.StubOptions">
  145. <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>
  146. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  147. <p>A value encapsulating the various options for creation of a Stub.</p>
  148. <p>This class and its instances have no supported interface - it exists to define
  149. the type of its instances and its instances exist to be passed to other
  150. functions.</p>
  151. </dd></dl>
  152. <dl class="function">
  153. <dt id="grpc.beta.implementations.dynamic_stub">
  154. <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>
  155. <dd><p>Creates a face.DynamicStub with which RPCs can be invoked.</p>
  156. <table class="docutils field-list" frame="void" rules="none">
  157. <col class="field-name" />
  158. <col class="field-body" />
  159. <tbody valign="top">
  160. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  161. <li><strong>channel</strong> &#8211; A Channel for the returned face.DynamicStub to use.</li>
  162. <li><strong>service</strong> &#8211; The package-qualified full name of the service.</li>
  163. <li><strong>cardinalities</strong> &#8211; A dictionary from RPC method name to cardinality.Cardinality
  164. value identifying the cardinality of the RPC method.</li>
  165. <li><strong>options</strong> &#8211; An optional StubOptions value further customizing the functionality
  166. of the returned face.DynamicStub.</li>
  167. </ul>
  168. </td>
  169. </tr>
  170. <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>
  171. </td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. </dd></dl>
  176. <dl class="function">
  177. <dt id="grpc.beta.implementations.generic_stub">
  178. <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>
  179. <dd><p>Creates a face.GenericStub on which RPCs can be made.</p>
  180. <table class="docutils field-list" frame="void" rules="none">
  181. <col class="field-name" />
  182. <col class="field-body" />
  183. <tbody valign="top">
  184. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  185. <li><strong>channel</strong> &#8211; A Channel for use by the created stub.</li>
  186. <li><strong>options</strong> &#8211; A StubOptions customizing the created stub.</li>
  187. </ul>
  188. </td>
  189. </tr>
  190. <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>
  191. </td>
  192. </tr>
  193. </tbody>
  194. </table>
  195. </dd></dl>
  196. <dl class="function">
  197. <dt id="grpc.beta.implementations.google_call_credentials">
  198. <code class="descclassname">grpc.beta.implementations.</code><code class="descname">google_call_credentials</code><span class="sig-paren">(</span><em>credentials</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/beta/implementations.html#google_call_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.beta.implementations.google_call_credentials" title="Permalink to this definition">¶</a></dt>
  199. <dd><p>Construct CallCredentials from GoogleCredentials.</p>
  200. <table class="docutils field-list" frame="void" rules="none">
  201. <col class="field-name" />
  202. <col class="field-body" />
  203. <tbody valign="top">
  204. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>credentials</strong> &#8211; A GoogleCredentials object from the oauth2client library.</td>
  205. </tr>
  206. <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>
  207. </tr>
  208. </tbody>
  209. </table>
  210. </dd></dl>
  211. <dl class="function">
  212. <dt id="grpc.beta.implementations.insecure_channel">
  213. <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>
  214. <dd><p>Creates an insecure Channel to a remote host.</p>
  215. <table class="docutils field-list" frame="void" rules="none">
  216. <col class="field-name" />
  217. <col class="field-body" />
  218. <tbody valign="top">
  219. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  220. <li><strong>host</strong> &#8211; The name of the remote host to which to connect.</li>
  221. <li><strong>port</strong> &#8211; The port of the remote host to which to connect.
  222. If None only the &#8216;host&#8217; part will be used.</li>
  223. </ul>
  224. </td>
  225. </tr>
  226. <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>
  227. </td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. </dd></dl>
  232. <dl class="function">
  233. <dt id="grpc.beta.implementations.secure_channel">
  234. <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>
  235. <dd><p>Creates a secure Channel to a remote host.</p>
  236. <table class="docutils field-list" frame="void" rules="none">
  237. <col class="field-name" />
  238. <col class="field-body" />
  239. <tbody valign="top">
  240. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  241. <li><strong>host</strong> &#8211; The name of the remote host to which to connect.</li>
  242. <li><strong>port</strong> &#8211; The port of the remote host to which to connect.
  243. If None only the &#8216;host&#8217; part will be used.</li>
  244. <li><strong>channel_credentials</strong> &#8211; A ChannelCredentials.</li>
  245. </ul>
  246. </td>
  247. </tr>
  248. <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>
  249. </td>
  250. </tr>
  251. </tbody>
  252. </table>
  253. </dd></dl>
  254. <dl class="function">
  255. <dt id="grpc.beta.implementations.server">
  256. <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>
  257. <dd><p>Creates an interfaces.Server with which RPCs can be serviced.</p>
  258. <table class="docutils field-list" frame="void" rules="none">
  259. <col class="field-name" />
  260. <col class="field-body" />
  261. <tbody valign="top">
  262. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  263. <li><strong>service_implementations</strong> &#8211; A dictionary from service name-method name pair to
  264. face.MethodImplementation.</li>
  265. <li><strong>options</strong> &#8211; An optional ServerOptions value further customizing the
  266. functionality of the returned Server.</li>
  267. </ul>
  268. </td>
  269. </tr>
  270. <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>
  271. </td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </dd></dl>
  276. <dl class="function">
  277. <dt id="grpc.beta.implementations.server_options">
  278. <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>
  279. <dd><p>Creates a ServerOptions value to be passed at server creation.</p>
  280. <p>All parameters are optional and should always be passed by keyword.</p>
  281. <table class="docutils field-list" frame="void" rules="none">
  282. <col class="field-name" />
  283. <col class="field-body" />
  284. <tbody valign="top">
  285. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  286. <li><strong>multi_method_implementation</strong> &#8211; A face.MultiMethodImplementation to be called
  287. to service an RPC if the server has no specific method implementation for
  288. the name of the RPC for which service was requested.</li>
  289. <li><strong>request_deserializers</strong> &#8211; A dictionary from service name-method name pair to
  290. request deserialization behavior.</li>
  291. <li><strong>response_serializers</strong> &#8211; A dictionary from service name-method name pair to
  292. response serialization behavior.</li>
  293. <li><strong>thread_pool</strong> &#8211; A thread pool to use in stubs.</li>
  294. <li><strong>thread_pool_size</strong> &#8211; The size of thread pool to create for use in stubs;
  295. ignored if thread_pool has been passed.</li>
  296. <li><strong>default_timeout</strong> &#8211; A duration in seconds to allow for RPC service when
  297. servicing RPCs that did not include a timeout value when invoked.</li>
  298. <li><strong>maximum_timeout</strong> &#8211; A duration in seconds to allow for RPC service when
  299. servicing RPCs no matter what timeout value was passed when the RPC was
  300. invoked.</li>
  301. </ul>
  302. </td>
  303. </tr>
  304. <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>
  305. </td>
  306. </tr>
  307. </tbody>
  308. </table>
  309. </dd></dl>
  310. <dl class="function">
  311. <dt id="grpc.beta.implementations.stub_options">
  312. <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>
  313. <dd><p>Creates a StubOptions value to be passed at stub creation.</p>
  314. <p>All parameters are optional and should always be passed by keyword.</p>
  315. <table class="docutils field-list" frame="void" rules="none">
  316. <col class="field-name" />
  317. <col class="field-body" />
  318. <tbody valign="top">
  319. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  320. <li><strong>host</strong> &#8211; A host string to set on RPC calls.</li>
  321. <li><strong>request_serializers</strong> &#8211; A dictionary from service name-method name pair to
  322. request serialization behavior.</li>
  323. <li><strong>response_deserializers</strong> &#8211; A dictionary from service name-method name pair to
  324. response deserialization behavior.</li>
  325. <li><strong>metadata_transformer</strong> &#8211; A callable that given a metadata object produces
  326. another metadata object to be used in the underlying communication on the
  327. wire.</li>
  328. <li><strong>thread_pool</strong> &#8211; A thread pool to use in stubs.</li>
  329. <li><strong>thread_pool_size</strong> &#8211; The size of thread pool to create for use in stubs;
  330. ignored if thread_pool has been passed.</li>
  331. </ul>
  332. </td>
  333. </tr>
  334. <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>
  335. </td>
  336. </tr>
  337. </tbody>
  338. </table>
  339. </dd></dl>
  340. </div>
  341. <div class="section" id="module-grpc.beta.interfaces">
  342. <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>
  343. <p>Constants and interfaces of the Beta API of gRPC Python.</p>
  344. <dl class="class">
  345. <dt id="grpc.beta.interfaces.GRPCCallOptions">
  346. <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>
  347. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  348. <p>A value encapsulating gRPC-specific options passed on RPC invocation.</p>
  349. <p>This class and its instances have no supported interface - it exists to
  350. define the type of its instances and its instances exist to be passed to
  351. other functions.</p>
  352. </dd></dl>
  353. <dl class="class">
  354. <dt id="grpc.beta.interfaces.GRPCInvocationContext">
  355. <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>
  356. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  357. <p>Exposes gRPC-specific options and behaviors to code invoking RPCs.</p>
  358. <dl class="method">
  359. <dt id="grpc.beta.interfaces.GRPCInvocationContext.disable_next_request_compression">
  360. <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>
  361. <dd><p>Disables compression of the next request passed by the application.</p>
  362. </dd></dl>
  363. </dd></dl>
  364. <dl class="class">
  365. <dt id="grpc.beta.interfaces.GRPCServicerContext">
  366. <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>
  367. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  368. <p>Exposes gRPC-specific options and behaviors to code servicing RPCs.</p>
  369. <dl class="method">
  370. <dt id="grpc.beta.interfaces.GRPCServicerContext.disable_next_response_compression">
  371. <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>
  372. <dd><p>Disables compression of the next response passed by the application.</p>
  373. </dd></dl>
  374. <dl class="method">
  375. <dt id="grpc.beta.interfaces.GRPCServicerContext.peer">
  376. <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>
  377. <dd><p>Identifies the peer that invoked the RPC being serviced.</p>
  378. <table class="docutils field-list" frame="void" rules="none">
  379. <col class="field-name" />
  380. <col class="field-body" />
  381. <tbody valign="top">
  382. <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>
  383. </tr>
  384. </tbody>
  385. </table>
  386. </dd></dl>
  387. </dd></dl>
  388. <dl class="class">
  389. <dt id="grpc.beta.interfaces.Server">
  390. <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>
  391. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  392. <p>Services RPCs.</p>
  393. <dl class="method">
  394. <dt id="grpc.beta.interfaces.Server.add_insecure_port">
  395. <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>
  396. <dd><p>Reserves a port for insecure RPC service once this Server becomes active.</p>
  397. <p>This method may only be called before calling this Server&#8217;s start method is
  398. called.</p>
  399. <table class="docutils field-list" frame="void" rules="none">
  400. <col class="field-name" />
  401. <col class="field-body" />
  402. <tbody valign="top">
  403. <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>
  404. </tr>
  405. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  406. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  407. <dd>started. This is typically the same number as the port number contained
  408. in the passed address, but will likely be different if the port number
  409. contained in the passed address was zero.</dd>
  410. </dl>
  411. </td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. </dd></dl>
  416. <dl class="method">
  417. <dt id="grpc.beta.interfaces.Server.add_secure_port">
  418. <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>
  419. <dd><p>Reserves a port for secure RPC service after this Server becomes active.</p>
  420. <p>This method may only be called before calling this Server&#8217;s start method is
  421. called.</p>
  422. <table class="docutils field-list" frame="void" rules="none">
  423. <col class="field-name" />
  424. <col class="field-body" />
  425. <tbody valign="top">
  426. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  427. <li><strong>address</strong> &#8211; The address for which to open a port.</li>
  428. <li><strong>server_credentials</strong> &#8211; A ServerCredentials.</li>
  429. </ul>
  430. </td>
  431. </tr>
  432. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  433. <dt>An integer port on which RPCs will be serviced after this link has been</dt>
  434. <dd><p class="first last">started. This is typically the same number as the port number contained
  435. in the passed address, but will likely be different if the port number
  436. contained in the passed address was zero.</p>
  437. </dd>
  438. </dl>
  439. </p>
  440. </td>
  441. </tr>
  442. </tbody>
  443. </table>
  444. </dd></dl>
  445. <dl class="method">
  446. <dt id="grpc.beta.interfaces.Server.start">
  447. <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>
  448. <dd><p>Starts this Server&#8217;s service of RPCs.</p>
  449. <p>This method may only be called while the server is not serving RPCs (i.e. it
  450. is not idempotent).</p>
  451. </dd></dl>
  452. <dl class="method">
  453. <dt id="grpc.beta.interfaces.Server.stop">
  454. <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>
  455. <dd><p>Stops this Server&#8217;s service of RPCs.</p>
  456. <p>All calls to this method immediately stop service of new RPCs. When existing
  457. RPCs are aborted is controlled by the grace period parameter passed to this
  458. method.</p>
  459. <p>This method may be called at any time and is idempotent. Passing a smaller
  460. grace value than has been passed in a previous call will have the effect of
  461. stopping the Server sooner. Passing a larger grace value than has been
  462. passed in a previous call will not have the effect of stopping the server
  463. later.</p>
  464. <table class="docutils field-list" frame="void" rules="none">
  465. <col class="field-name" />
  466. <col class="field-body" />
  467. <tbody valign="top">
  468. <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
  469. before being aborted by this Server&#8217;s stopping. May be zero for
  470. immediate abortion of all in-progress RPCs.</td>
  471. </tr>
  472. <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
  473. stopped. The returned event may not be set until after the full grace
  474. period (if some ongoing RPC continues for the full length of the period)
  475. of it may be set much sooner (such as if this Server had no RPCs underway
  476. at the time it was stopped or if all RPCs that it had underway completed
  477. very early in the grace period).</td>
  478. </tr>
  479. </tbody>
  480. </table>
  481. </dd></dl>
  482. </dd></dl>
  483. <dl class="function">
  484. <dt id="grpc.beta.interfaces.grpc_call_options">
  485. <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>
  486. <dd><p>Creates a GRPCCallOptions value to be passed at RPC invocation.</p>
  487. <p>All parameters are optional and should always be passed by keyword.</p>
  488. <table class="docutils field-list" frame="void" rules="none">
  489. <col class="field-name" />
  490. <col class="field-body" />
  491. <tbody valign="top">
  492. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  493. <li><strong>disable_compression</strong> &#8211; A boolean indicating whether or not compression should
  494. be disabled for the request object of the RPC. Only valid for
  495. request-unary RPCs.</li>
  496. <li><strong>credentials</strong> &#8211; A CallCredentials object to use for the invoked RPC.</li>
  497. </ul>
  498. </td>
  499. </tr>
  500. </tbody>
  501. </table>
  502. </dd></dl>
  503. </div>
  504. <div class="section" id="module-grpc.beta.utilities">
  505. <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>
  506. <p>Utilities for the gRPC Python Beta API.</p>
  507. <dl class="function">
  508. <dt id="grpc.beta.utilities.channel_ready_future">
  509. <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>
  510. <dd><p>Creates a future.Future tracking when an implementations.Channel is ready.</p>
  511. <p>Cancelling the returned future.Future does not tell the given
  512. implementations.Channel to abandon attempts it may have been making to
  513. connect; cancelling merely deactivates the return future.Future&#8217;s
  514. subscription to the given implementations.Channel&#8217;s connectivity.</p>
  515. <table class="docutils field-list" frame="void" rules="none">
  516. <col class="field-name" />
  517. <col class="field-body" />
  518. <tbody valign="top">
  519. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel</strong> &#8211; An implementations.Channel.</td>
  520. </tr>
  521. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  522. <dt>A future.Future that matures when the given Channel has connectivity</dt>
  523. <dd>interfaces.ChannelConnectivity.READY.</dd>
  524. </dl>
  525. </td>
  526. </tr>
  527. </tbody>
  528. </table>
  529. </dd></dl>
  530. </div>
  531. <div class="section" id="module-grpc.beta">
  532. <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc.beta" title="Permalink to this headline">¶</a></h2>
  533. </div>
  534. </div>
  535. </div>
  536. <div class="articleComments">
  537. </div>
  538. </div>
  539. <footer>
  540. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  541. <a href="grpc.framework.html" class="btn btn-neutral float-right" title="grpc.framework package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
  542. <a href="grpc.html" class="btn btn-neutral" title="grpc package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  543. </div>
  544. <hr/>
  545. <div role="contentinfo">
  546. <p>
  547. &copy; Copyright 2016, The gRPC Authors.
  548. </p>
  549. </div>
  550. 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>.
  551. </footer>
  552. </div>
  553. </div>
  554. </section>
  555. </div>
  556. <script type="text/javascript">
  557. var DOCUMENTATION_OPTIONS = {
  558. URL_ROOT:'./',
  559. VERSION:'1.2.0',
  560. COLLAPSE_INDEX:false,
  561. FILE_SUFFIX:'.html',
  562. HAS_SOURCE: true,
  563. SOURCELINK_SUFFIX: '.txt'
  564. };
  565. </script>
  566. <script type="text/javascript" src="_static/jquery.js"></script>
  567. <script type="text/javascript" src="_static/underscore.js"></script>
  568. <script type="text/javascript" src="_static/doctools.js"></script>
  569. <script type="text/javascript" src="_static/js/theme.js"></script>
  570. <script type="text/javascript">
  571. jQuery(function () {
  572. SphinxRtdTheme.StickyNav.enable();
  573. });
  574. </script>
  575. </body>
  576. </html>