grpc.framework.alpha.html 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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.framework.alpha package &mdash; grpcio 0.11.0b1 documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <link rel="top" title="grpcio 0.11.0b1 documentation" href="index.html"/>
  10. <link rel="up" title="grpc.framework package" href="grpc.framework.html"/>
  11. <link rel="next" title="grpc.framework.base package" href="grpc.framework.base.html"/>
  12. <link rel="prev" title="grpc.framework package" href="grpc.framework.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.11.0b1
  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"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a></li>
  38. <li class="toctree-l3"><a class="reference internal" href="grpc.early_adopter.html">grpc.early_adopter package</a></li>
  39. <li class="toctree-l3 current"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a><ul class="current">
  40. <li class="toctree-l4 current"><a class="reference internal" href="grpc.framework.html#subpackages">Subpackages</a></li>
  41. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.html#module-grpc.framework">Module contents</a></li>
  42. </ul>
  43. </li>
  44. </ul>
  45. </li>
  46. <li class="toctree-l2"><a class="reference internal" href="grpc.html#module-grpc">Module contents</a></li>
  47. </ul>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </nav>
  53. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  54. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  55. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  56. <a href="index.html">grpcio</a>
  57. </nav>
  58. <div class="wy-nav-content">
  59. <div class="rst-content">
  60. <div role="navigation" aria-label="breadcrumbs navigation">
  61. <ul class="wy-breadcrumbs">
  62. <li><a href="index.html">Docs</a> &raquo;</li>
  63. <li><a href="grpc.html">grpc package</a> &raquo;</li>
  64. <li><a href="grpc.framework.html">grpc.framework package</a> &raquo;</li>
  65. <li>grpc.framework.alpha package</li>
  66. <li class="wy-breadcrumbs-aside">
  67. <a href="_sources/grpc.framework.alpha.txt" rel="nofollow"> View page source</a>
  68. </li>
  69. </ul>
  70. <hr/>
  71. </div>
  72. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  73. <div itemprop="articleBody">
  74. <div class="section" id="grpc-framework-alpha-package">
  75. <h1>grpc.framework.alpha package<a class="headerlink" href="#grpc-framework-alpha-package" title="Permalink to this headline">¶</a></h1>
  76. <div class="section" id="submodules">
  77. <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
  78. </div>
  79. <div class="section" id="module-grpc.framework.alpha.exceptions">
  80. <span id="grpc-framework-alpha-exceptions-module"></span><h2>grpc.framework.alpha.exceptions module<a class="headerlink" href="#module-grpc.framework.alpha.exceptions" title="Permalink to this headline">¶</a></h2>
  81. <p>Exceptions raised by GRPC.</p>
  82. <p>Only GRPC should instantiate and raise these exceptions.</p>
  83. <dl class="exception">
  84. <dt id="grpc.framework.alpha.exceptions.CancellationError">
  85. <em class="property">exception </em><code class="descclassname">grpc.framework.alpha.exceptions.</code><code class="descname">CancellationError</code><a class="reference internal" href="_modules/grpc/framework/alpha/exceptions.html#CancellationError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.exceptions.CancellationError" title="Permalink to this definition">¶</a></dt>
  86. <dd><p>Bases: <a class="reference internal" href="#grpc.framework.alpha.exceptions.RpcError" title="grpc.framework.alpha.exceptions.RpcError"><code class="xref py py-class docutils literal"><span class="pre">grpc.framework.alpha.exceptions.RpcError</span></code></a></p>
  87. <p>Indicates that an RPC has been cancelled.</p>
  88. </dd></dl>
  89. <dl class="exception">
  90. <dt id="grpc.framework.alpha.exceptions.ExpirationError">
  91. <em class="property">exception </em><code class="descclassname">grpc.framework.alpha.exceptions.</code><code class="descname">ExpirationError</code><a class="reference internal" href="_modules/grpc/framework/alpha/exceptions.html#ExpirationError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.exceptions.ExpirationError" title="Permalink to this definition">¶</a></dt>
  92. <dd><p>Bases: <a class="reference internal" href="#grpc.framework.alpha.exceptions.RpcError" title="grpc.framework.alpha.exceptions.RpcError"><code class="xref py py-class docutils literal"><span class="pre">grpc.framework.alpha.exceptions.RpcError</span></code></a></p>
  93. <p>Indicates that an RPC has expired (&#8220;timed out&#8221;).</p>
  94. </dd></dl>
  95. <dl class="exception">
  96. <dt id="grpc.framework.alpha.exceptions.RpcError">
  97. <em class="property">exception </em><code class="descclassname">grpc.framework.alpha.exceptions.</code><code class="descname">RpcError</code><a class="reference internal" href="_modules/grpc/framework/alpha/exceptions.html#RpcError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.exceptions.RpcError" title="Permalink to this definition">¶</a></dt>
  98. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
  99. <p>Common super type for all exceptions raised by GRPC.</p>
  100. </dd></dl>
  101. </div>
  102. <div class="section" id="module-grpc.framework.alpha.interfaces">
  103. <span id="grpc-framework-alpha-interfaces-module"></span><h2>grpc.framework.alpha.interfaces module<a class="headerlink" href="#module-grpc.framework.alpha.interfaces" title="Permalink to this headline">¶</a></h2>
  104. <p>Interfaces of GRPC.</p>
  105. <dl class="class">
  106. <dt id="grpc.framework.alpha.interfaces.Abortion">
  107. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">Abortion</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#Abortion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.Abortion" title="Permalink to this definition">¶</a></dt>
  108. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  109. <p>Categories of RPC abortion.</p>
  110. </dd></dl>
  111. <dl class="class">
  112. <dt id="grpc.framework.alpha.interfaces.CancellableIterator">
  113. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">CancellableIterator</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#CancellableIterator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.CancellableIterator" title="Permalink to this definition">¶</a></dt>
  114. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  115. <p>Implements the Iterator protocol and affords a cancel method.</p>
  116. <dl class="method">
  117. <dt id="grpc.framework.alpha.interfaces.CancellableIterator.__iter__">
  118. <code class="descname">__iter__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#CancellableIterator.__iter__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.CancellableIterator.__iter__" title="Permalink to this definition">¶</a></dt>
  119. <dd><p>Returns the self object in accordance with the Iterator protocol.</p>
  120. </dd></dl>
  121. <dl class="method">
  122. <dt id="grpc.framework.alpha.interfaces.CancellableIterator.cancel">
  123. <code class="descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#CancellableIterator.cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.CancellableIterator.cancel" title="Permalink to this definition">¶</a></dt>
  124. <dd><p>Requests cancellation of whatever computation underlies this iterator.</p>
  125. </dd></dl>
  126. <dl class="method">
  127. <dt id="grpc.framework.alpha.interfaces.CancellableIterator.next">
  128. <code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#CancellableIterator.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.CancellableIterator.next" title="Permalink to this definition">¶</a></dt>
  129. <dd><p>Returns a value or raises StopIteration per the Iterator protocol.</p>
  130. </dd></dl>
  131. </dd></dl>
  132. <dl class="class">
  133. <dt id="grpc.framework.alpha.interfaces.Cardinality">
  134. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">Cardinality</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#Cardinality"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.Cardinality" title="Permalink to this definition">¶</a></dt>
  135. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  136. <p>Constants for the four cardinalities of RPC.</p>
  137. </dd></dl>
  138. <dl class="class">
  139. <dt id="grpc.framework.alpha.interfaces.RpcContext">
  140. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">RpcContext</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcContext" title="Permalink to this definition">¶</a></dt>
  141. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  142. <p>Provides RPC-related information and action.</p>
  143. <dl class="method">
  144. <dt id="grpc.framework.alpha.interfaces.RpcContext.add_abortion_callback">
  145. <code class="descname">add_abortion_callback</code><span class="sig-paren">(</span><em>abortion_callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcContext.add_abortion_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcContext.add_abortion_callback" title="Permalink to this definition">¶</a></dt>
  146. <dd><p>Registers a callback to be called if the RPC is aborted.
  147. :param abortion_callback: A callable to be called and passed an Abortion value</p>
  148. <blockquote>
  149. <div>in the event of RPC abortion.</div></blockquote>
  150. </dd></dl>
  151. <dl class="method">
  152. <dt id="grpc.framework.alpha.interfaces.RpcContext.is_active">
  153. <code class="descname">is_active</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcContext.is_active"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcContext.is_active" title="Permalink to this definition">¶</a></dt>
  154. <dd><p>Describes whether the RPC is active or has terminated.</p>
  155. </dd></dl>
  156. <dl class="method">
  157. <dt id="grpc.framework.alpha.interfaces.RpcContext.time_remaining">
  158. <code class="descname">time_remaining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcContext.time_remaining"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcContext.time_remaining" title="Permalink to this definition">¶</a></dt>
  159. <dd><p>Describes the length of allowed time remaining for the RPC.
  160. :returns: A nonnegative float indicating the length of allowed time in seconds</p>
  161. <blockquote>
  162. <div>remaining for the RPC to complete before it is considered to have timed
  163. out.</div></blockquote>
  164. </dd></dl>
  165. </dd></dl>
  166. <dl class="class">
  167. <dt id="grpc.framework.alpha.interfaces.RpcMethodDescription">
  168. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">RpcMethodDescription</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodDescription"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodDescription" title="Permalink to this definition">¶</a></dt>
  169. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  170. <p>A type for the common aspects of RPC method descriptions.</p>
  171. <dl class="method">
  172. <dt id="grpc.framework.alpha.interfaces.RpcMethodDescription.cardinality">
  173. <code class="descname">cardinality</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodDescription.cardinality"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodDescription.cardinality" title="Permalink to this definition">¶</a></dt>
  174. <dd><p>Identifies the cardinality of this RpcMethodDescription.</p>
  175. <table class="docutils field-list" frame="void" rules="none">
  176. <col class="field-name" />
  177. <col class="field-body" />
  178. <tbody valign="top">
  179. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A Cardinality value identifying whether or not this
  180. RpcMethodDescription is request-unary or request-streaming and
  181. whether or not it is response-unary or response-streaming.</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </dd></dl>
  186. </dd></dl>
  187. <dl class="class">
  188. <dt id="grpc.framework.alpha.interfaces.RpcMethodInvocationDescription">
  189. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">RpcMethodInvocationDescription</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodInvocationDescription"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodInvocationDescription" title="Permalink to this definition">¶</a></dt>
  190. <dd><p>Bases: <a class="reference internal" href="#grpc.framework.alpha.interfaces.RpcMethodDescription" title="grpc.framework.alpha.interfaces.RpcMethodDescription"><code class="xref py py-class docutils literal"><span class="pre">grpc.framework.alpha.interfaces.RpcMethodDescription</span></code></a></p>
  191. <p>Invocation-side description of an RPC method.</p>
  192. <dl class="method">
  193. <dt id="grpc.framework.alpha.interfaces.RpcMethodInvocationDescription.deserialize_response">
  194. <code class="descname">deserialize_response</code><span class="sig-paren">(</span><em>serialized_response</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodInvocationDescription.deserialize_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodInvocationDescription.deserialize_response" title="Permalink to this definition">¶</a></dt>
  195. <dd><p>Deserializes a response value.</p>
  196. <table class="docutils field-list" frame="void" rules="none">
  197. <col class="field-name" />
  198. <col class="field-body" />
  199. <tbody valign="top">
  200. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>serialized_response</strong> &#8211; A bytestring that is the serialization of a response
  201. value appropriate for the RPC method described by this
  202. RpcMethodInvocationDescription.</td>
  203. </tr>
  204. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A response value corresponding to the given bytestring.</td>
  205. </tr>
  206. </tbody>
  207. </table>
  208. </dd></dl>
  209. <dl class="method">
  210. <dt id="grpc.framework.alpha.interfaces.RpcMethodInvocationDescription.serialize_request">
  211. <code class="descname">serialize_request</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodInvocationDescription.serialize_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodInvocationDescription.serialize_request" title="Permalink to this definition">¶</a></dt>
  212. <dd><p>Serializes a request value.</p>
  213. <table class="docutils field-list" frame="void" rules="none">
  214. <col class="field-name" />
  215. <col class="field-body" />
  216. <tbody valign="top">
  217. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>request</strong> &#8211; A request value appropriate for the RPC method described by this
  218. RpcMethodInvocationDescription.</td>
  219. </tr>
  220. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The serialization of the given request value as a
  221. bytestring.</td>
  222. </tr>
  223. </tbody>
  224. </table>
  225. </dd></dl>
  226. </dd></dl>
  227. <dl class="class">
  228. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription">
  229. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">RpcMethodServiceDescription</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription" title="Permalink to this definition">¶</a></dt>
  230. <dd><p>Bases: <a class="reference internal" href="#grpc.framework.alpha.interfaces.RpcMethodDescription" title="grpc.framework.alpha.interfaces.RpcMethodDescription"><code class="xref py py-class docutils literal"><span class="pre">grpc.framework.alpha.interfaces.RpcMethodDescription</span></code></a></p>
  231. <p>Service-side description of an RPC method.</p>
  232. <dl class="method">
  233. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.deserialize_request">
  234. <code class="descname">deserialize_request</code><span class="sig-paren">(</span><em>serialized_request</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.deserialize_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.deserialize_request" title="Permalink to this definition">¶</a></dt>
  235. <dd><p>Deserializes a request value.</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"><strong>serialized_request</strong> &#8211; A bytestring that is the serialization of a request
  241. value appropriate for the RPC method described by this
  242. RpcMethodServiceDescription.</td>
  243. </tr>
  244. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A request value corresponding to the given bytestring.</td>
  245. </tr>
  246. </tbody>
  247. </table>
  248. </dd></dl>
  249. <dl class="method">
  250. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.serialize_response">
  251. <code class="descname">serialize_response</code><span class="sig-paren">(</span><em>response</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.serialize_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.serialize_response" title="Permalink to this definition">¶</a></dt>
  252. <dd><p>Serializes a response value.</p>
  253. <table class="docutils field-list" frame="void" rules="none">
  254. <col class="field-name" />
  255. <col class="field-body" />
  256. <tbody valign="top">
  257. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>response</strong> &#8211; A response value appropriate for the RPC method described by
  258. this RpcMethodServiceDescription.</td>
  259. </tr>
  260. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The serialization of the given response value as a
  261. bytestring.</td>
  262. </tr>
  263. </tbody>
  264. </table>
  265. </dd></dl>
  266. <dl class="method">
  267. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_stream_stream">
  268. <code class="descname">service_stream_stream</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.service_stream_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_stream_stream" title="Permalink to this definition">¶</a></dt>
  269. <dd><p>Carries out this RPC.</p>
  270. <p>This method may only be called if the cardinality of this
  271. RpcMethodServiceDescription is Cardinality.STREAM_STREAM.</p>
  272. <table class="docutils field-list" frame="void" rules="none">
  273. <col class="field-name" />
  274. <col class="field-body" />
  275. <tbody valign="top">
  276. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  277. <li><strong>request_iterator</strong> &#8211; An iterator of request values appropriate for the RPC
  278. method described by this RpcMethodServiceDescription.</li>
  279. <li><strong>context</strong> &#8211; An RpcContext object for the RPC.</li>
  280. </ul>
  281. </td>
  282. </tr>
  283. <tr class="field-even field"><th class="field-name">Yields:</th><td class="field-body"><p class="first last">Zero or more response values appropriate for the RPC method described by
  284. this RpcMethodServiceDescription.</p>
  285. </td>
  286. </tr>
  287. </tbody>
  288. </table>
  289. </dd></dl>
  290. <dl class="method">
  291. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_stream_unary">
  292. <code class="descname">service_stream_unary</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.service_stream_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_stream_unary" title="Permalink to this definition">¶</a></dt>
  293. <dd><p>Carries out this RPC.</p>
  294. <p>This method may only be called if the cardinality of this
  295. RpcMethodServiceDescription is Cardinality.STREAM_UNARY.</p>
  296. <table class="docutils field-list" frame="void" rules="none">
  297. <col class="field-name" />
  298. <col class="field-body" />
  299. <tbody valign="top">
  300. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  301. <li><strong>request_iterator</strong> &#8211; An iterator of request values appropriate for the RPC
  302. method described by this RpcMethodServiceDescription.</li>
  303. <li><strong>context</strong> &#8211; An RpcContext object for the RPC.</li>
  304. </ul>
  305. </td>
  306. </tr>
  307. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A response value appropriate for the RPC method described by this
  308. RpcMethodServiceDescription.</p>
  309. </td>
  310. </tr>
  311. </tbody>
  312. </table>
  313. </dd></dl>
  314. <dl class="method">
  315. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_unary_stream">
  316. <code class="descname">service_unary_stream</code><span class="sig-paren">(</span><em>request</em>, <em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.service_unary_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_unary_stream" title="Permalink to this definition">¶</a></dt>
  317. <dd><p>Carries out this RPC.</p>
  318. <p>This method may only be called if the cardinality of this
  319. RpcMethodServiceDescription is Cardinality.UNARY_STREAM.</p>
  320. <table class="docutils field-list" frame="void" rules="none">
  321. <col class="field-name" />
  322. <col class="field-body" />
  323. <tbody valign="top">
  324. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  325. <li><strong>request</strong> &#8211; A request value appropriate for the RPC method described by this
  326. RpcMethodServiceDescription.</li>
  327. <li><strong>context</strong> &#8211; An RpcContext object for the RPC.</li>
  328. </ul>
  329. </td>
  330. </tr>
  331. <tr class="field-even field"><th class="field-name">Yields:</th><td class="field-body"><p class="first last">Zero or more response values appropriate for the RPC method described by
  332. this RpcMethodServiceDescription.</p>
  333. </td>
  334. </tr>
  335. </tbody>
  336. </table>
  337. </dd></dl>
  338. <dl class="method">
  339. <dt id="grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_unary_unary">
  340. <code class="descname">service_unary_unary</code><span class="sig-paren">(</span><em>request</em>, <em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#RpcMethodServiceDescription.service_unary_unary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.RpcMethodServiceDescription.service_unary_unary" title="Permalink to this definition">¶</a></dt>
  341. <dd><p>Carries out this RPC.</p>
  342. <p>This method may only be called if the cardinality of this
  343. RpcMethodServiceDescription is Cardinality.UNARY_UNARY.</p>
  344. <table class="docutils field-list" frame="void" rules="none">
  345. <col class="field-name" />
  346. <col class="field-body" />
  347. <tbody valign="top">
  348. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  349. <li><strong>request</strong> &#8211; A request value appropriate for the RPC method described by this
  350. RpcMethodServiceDescription.</li>
  351. <li><strong>context</strong> &#8211; An RpcContext object for the RPC.</li>
  352. </ul>
  353. </td>
  354. </tr>
  355. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A response value appropriate for the RPC method described by this
  356. RpcMethodServiceDescription.</p>
  357. </td>
  358. </tr>
  359. </tbody>
  360. </table>
  361. </dd></dl>
  362. </dd></dl>
  363. <dl class="class">
  364. <dt id="grpc.framework.alpha.interfaces.Server">
  365. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">Server</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#Server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.Server" title="Permalink to this definition">¶</a></dt>
  366. <dd><p>Bases: <a class="reference internal" href="grpc.framework.foundation.html#grpc.framework.foundation.activated.Activated" title="grpc.framework.foundation.activated.Activated"><code class="xref py py-class docutils literal"><span class="pre">grpc.framework.foundation.activated.Activated</span></code></a></p>
  367. <p>A GRPC Server.</p>
  368. <dl class="method">
  369. <dt id="grpc.framework.alpha.interfaces.Server.port">
  370. <code class="descname">port</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#Server.port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.Server.port" title="Permalink to this definition">¶</a></dt>
  371. <dd><p>Reports the port on which the server is serving.</p>
  372. <p>This method may only be called while the server is activated.</p>
  373. <table class="docutils field-list" frame="void" rules="none">
  374. <col class="field-name" />
  375. <col class="field-body" />
  376. <tbody valign="top">
  377. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The port on which the server is serving.</td>
  378. </tr>
  379. </tbody>
  380. </table>
  381. </dd></dl>
  382. </dd></dl>
  383. <dl class="class">
  384. <dt id="grpc.framework.alpha.interfaces.StreamUnarySyncAsync">
  385. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">StreamUnarySyncAsync</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#StreamUnarySyncAsync"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.StreamUnarySyncAsync" title="Permalink to this definition">¶</a></dt>
  386. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  387. <p>Affords invoking a stream-unary RPC synchronously or asynchronously.
  388. Values implementing this interface are directly callable and present an
  389. &#8220;async&#8221; method. Both calls take an iterator of request values and a numeric
  390. timeout. Direct invocation of a value of this type invokes its associated RPC
  391. and blocks until the RPC&#8217;s response is available. Calling the &#8220;async&#8221; method
  392. of a value of this type invokes its associated RPC and immediately returns a
  393. future.Future bound to the asynchronous execution of the RPC.</p>
  394. <dl class="method">
  395. <dt id="grpc.framework.alpha.interfaces.StreamUnarySyncAsync.__call__">
  396. <code class="descname">__call__</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#StreamUnarySyncAsync.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.StreamUnarySyncAsync.__call__" title="Permalink to this definition">¶</a></dt>
  397. <dd><p>Synchronously invokes the underlying RPC.</p>
  398. <table class="docutils field-list" frame="void" rules="none">
  399. <col class="field-name" />
  400. <col class="field-body" />
  401. <tbody valign="top">
  402. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  403. <li><strong>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  404. <li><strong>timeout</strong> &#8211; A duration of time in seconds to allow for the RPC.</li>
  405. </ul>
  406. </td>
  407. </tr>
  408. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The response value for the RPC.</p>
  409. </td>
  410. </tr>
  411. <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><code class="xref py py-exc docutils literal"><span class="pre">exceptions.RpcError</span></code> &#8211;
  412. Indicating that the RPC was aborted.</p>
  413. </td>
  414. </tr>
  415. </tbody>
  416. </table>
  417. </dd></dl>
  418. <dl class="method">
  419. <dt id="grpc.framework.alpha.interfaces.StreamUnarySyncAsync.async">
  420. <code class="descname">async</code><span class="sig-paren">(</span><em>request_iterator</em>, <em>timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#StreamUnarySyncAsync.async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.StreamUnarySyncAsync.async" title="Permalink to this definition">¶</a></dt>
  421. <dd><p>Asynchronously invokes the underlying RPC.</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>request_iterator</strong> &#8211; An iterator that yields request values for the RPC.</li>
  428. <li><strong>timeout</strong> &#8211; A duration of time in seconds to allow for the RPC.</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">A future.Future representing the RPC. In the event of RPC completion, the
  433. returned Future&#8217;s result value will be the response value of the RPC.
  434. In the event of RPC abortion, the returned Future&#8217;s exception value
  435. will be an exceptions.RpcError.</p>
  436. </td>
  437. </tr>
  438. </tbody>
  439. </table>
  440. </dd></dl>
  441. </dd></dl>
  442. <dl class="class">
  443. <dt id="grpc.framework.alpha.interfaces.Stub">
  444. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">Stub</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#Stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.Stub" title="Permalink to this definition">¶</a></dt>
  445. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  446. <p>A stub with callable RPC method names for attributes.</p>
  447. <p>Instances of this type are context managers and only afford RPC invocation
  448. when used in context.</p>
  449. <p>Instances of this type, when used in context, respond to attribute access
  450. as follows: if the requested attribute is the name of a unary-unary RPC
  451. method, the value of the attribute will be a UnaryUnarySyncAsync with which
  452. to invoke the RPC method. If the requested attribute is the name of a
  453. unary-stream RPC method, the value of the attribute will be a callable taking
  454. a request object and a timeout parameter and returning a CancellableIterator
  455. that yields the response values of the RPC. If the requested attribute is the
  456. name of a stream-unary RPC method, the value of the attribute will be a
  457. StreamUnarySyncAsync with which to invoke the RPC method. If the requested
  458. attribute is the name of a stream-stream RPC method, the value of the
  459. attribute will be a callable taking an iterator of request objects and a
  460. timeout and returning a CancellableIterator that yields the response values
  461. of the RPC.</p>
  462. <p>In all cases indication of abortion is indicated by raising of
  463. exceptions.RpcError, exceptions.CancellationError,
  464. and exceptions.ExpirationError.</p>
  465. </dd></dl>
  466. <dl class="class">
  467. <dt id="grpc.framework.alpha.interfaces.UnaryUnarySyncAsync">
  468. <em class="property">class </em><code class="descclassname">grpc.framework.alpha.interfaces.</code><code class="descname">UnaryUnarySyncAsync</code><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#UnaryUnarySyncAsync"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.UnaryUnarySyncAsync" title="Permalink to this definition">¶</a></dt>
  469. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  470. <p>Affords invoking a unary-unary RPC synchronously or asynchronously.
  471. Values implementing this interface are directly callable and present an
  472. &#8220;async&#8221; method. Both calls take a request value and a numeric timeout.
  473. Direct invocation of a value of this type invokes its associated RPC and
  474. blocks until the RPC&#8217;s response is available. Calling the &#8220;async&#8221; method
  475. of a value of this type invokes its associated RPC and immediately returns a
  476. future.Future bound to the asynchronous execution of the RPC.</p>
  477. <dl class="method">
  478. <dt id="grpc.framework.alpha.interfaces.UnaryUnarySyncAsync.__call__">
  479. <code class="descname">__call__</code><span class="sig-paren">(</span><em>request</em>, <em>timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#UnaryUnarySyncAsync.__call__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.UnaryUnarySyncAsync.__call__" title="Permalink to this definition">¶</a></dt>
  480. <dd><p>Synchronously invokes the underlying RPC.
  481. :param request: The request value for the RPC.
  482. :param timeout: A duration of time in seconds to allow for the RPC.</p>
  483. <table class="docutils field-list" frame="void" rules="none">
  484. <col class="field-name" />
  485. <col class="field-body" />
  486. <tbody valign="top">
  487. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The response value for the RPC.</td>
  488. </tr>
  489. <tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">exceptions.RpcError</span></code> &#8211;
  490. Indicating that the RPC was aborted.</td>
  491. </tr>
  492. </tbody>
  493. </table>
  494. </dd></dl>
  495. <dl class="method">
  496. <dt id="grpc.framework.alpha.interfaces.UnaryUnarySyncAsync.async">
  497. <code class="descname">async</code><span class="sig-paren">(</span><em>request</em>, <em>timeout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/interfaces.html#UnaryUnarySyncAsync.async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.interfaces.UnaryUnarySyncAsync.async" title="Permalink to this definition">¶</a></dt>
  498. <dd><p>Asynchronously invokes the underlying RPC.
  499. :param request: The request value for the RPC.
  500. :param timeout: A duration of time in seconds to allow for the RPC.</p>
  501. <table class="docutils field-list" frame="void" rules="none">
  502. <col class="field-name" />
  503. <col class="field-body" />
  504. <tbody valign="top">
  505. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A future.Future representing the RPC. In the event of RPC completion, the
  506. returned Future&#8217;s result value will be the response value of the RPC.
  507. In the event of RPC abortion, the returned Future&#8217;s exception value
  508. will be an exceptions.RpcError.</td>
  509. </tr>
  510. </tbody>
  511. </table>
  512. </dd></dl>
  513. </dd></dl>
  514. </div>
  515. <div class="section" id="module-grpc.framework.alpha.utilities">
  516. <span id="grpc-framework-alpha-utilities-module"></span><h2>grpc.framework.alpha.utilities module<a class="headerlink" href="#module-grpc.framework.alpha.utilities" title="Permalink to this headline">¶</a></h2>
  517. <p>Utilities for use with GRPC.</p>
  518. <dl class="function">
  519. <dt id="grpc.framework.alpha.utilities.stream_stream_invocation_description">
  520. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">stream_stream_invocation_description</code><span class="sig-paren">(</span><em>request_serializer</em>, <em>response_deserializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#stream_stream_invocation_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.stream_stream_invocation_description" title="Permalink to this definition">¶</a></dt>
  521. <dd><p>Creates an interfaces.RpcMethodInvocationDescription for an RPC method.</p>
  522. <table class="docutils field-list" frame="void" rules="none">
  523. <col class="field-name" />
  524. <col class="field-body" />
  525. <tbody valign="top">
  526. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  527. <li><strong>request_serializer</strong> &#8211; A callable that when called on a request
  528. value returns a bytestring corresponding to that value.</li>
  529. <li><strong>response_deserializer</strong> &#8211; A callable that when called on a
  530. bytestring returns the response value corresponding to
  531. that bytestring.</li>
  532. </ul>
  533. </td>
  534. </tr>
  535. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodInvocationDescription constructed from the given
  536. arguments representing a streaming-request/streaming-response RPC
  537. method.</p>
  538. </td>
  539. </tr>
  540. </tbody>
  541. </table>
  542. </dd></dl>
  543. <dl class="function">
  544. <dt id="grpc.framework.alpha.utilities.stream_stream_service_description">
  545. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">stream_stream_service_description</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer</em>, <em>response_serializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#stream_stream_service_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.stream_stream_service_description" title="Permalink to this definition">¶</a></dt>
  546. <dd><p>Creates an interfaces.RpcMethodServiceDescription for the given behavior.</p>
  547. <table class="docutils field-list" frame="void" rules="none">
  548. <col class="field-name" />
  549. <col class="field-body" />
  550. <tbody valign="top">
  551. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  552. <li><strong>behavior</strong> &#8211; A callable that implements a stream-stream RPC
  553. method that accepts an iterator of zero or more requests
  554. and an interfaces.RpcContext and returns an iterator of
  555. zero or more responses.</li>
  556. <li><strong>request_deserializer</strong> &#8211; A callable that when called on a
  557. bytestring returns the request value corresponding to that
  558. bytestring.</li>
  559. <li><strong>response_serializer</strong> &#8211; A callable that when called on a
  560. response value returns the bytestring corresponding to
  561. that value.</li>
  562. </ul>
  563. </td>
  564. </tr>
  565. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodServiceDescription constructed from the given
  566. arguments representing a
  567. streaming-request/streaming-response RPC method.</p>
  568. </td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. </dd></dl>
  573. <dl class="function">
  574. <dt id="grpc.framework.alpha.utilities.stream_unary_invocation_description">
  575. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">stream_unary_invocation_description</code><span class="sig-paren">(</span><em>request_serializer</em>, <em>response_deserializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#stream_unary_invocation_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.stream_unary_invocation_description" title="Permalink to this definition">¶</a></dt>
  576. <dd><p>Creates an interfaces.RpcMethodInvocationDescription for an RPC method.</p>
  577. <table class="docutils field-list" frame="void" rules="none">
  578. <col class="field-name" />
  579. <col class="field-body" />
  580. <tbody valign="top">
  581. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  582. <li><strong>request_serializer</strong> &#8211; A callable that when called on a request
  583. value returns a bytestring corresponding to that value.</li>
  584. <li><strong>response_deserializer</strong> &#8211; A callable that when called on a
  585. bytestring returns the response value corresponding to
  586. that bytestring.</li>
  587. </ul>
  588. </td>
  589. </tr>
  590. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodInvocationDescription constructed from the given
  591. arguments representing a streaming-request/unary-response RPC method.</p>
  592. </td>
  593. </tr>
  594. </tbody>
  595. </table>
  596. </dd></dl>
  597. <dl class="function">
  598. <dt id="grpc.framework.alpha.utilities.stream_unary_service_description">
  599. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">stream_unary_service_description</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer</em>, <em>response_serializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#stream_unary_service_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.stream_unary_service_description" title="Permalink to this definition">¶</a></dt>
  600. <dd><p>Creates an interfaces.RpcMethodServiceDescription for the given behavior.</p>
  601. <table class="docutils field-list" frame="void" rules="none">
  602. <col class="field-name" />
  603. <col class="field-body" />
  604. <tbody valign="top">
  605. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  606. <li><strong>behavior</strong> &#8211; A callable that implements a stream-unary RPC
  607. method that accepts an iterator of zero or more requests
  608. and an interfaces.RpcContext and returns a single response.</li>
  609. <li><strong>request_deserializer</strong> &#8211; A callable that when called on a
  610. bytestring returns the request value corresponding to that
  611. bytestring.</li>
  612. <li><strong>response_serializer</strong> &#8211; A callable that when called on a
  613. response value returns the bytestring corresponding to
  614. that value.</li>
  615. </ul>
  616. </td>
  617. </tr>
  618. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodServiceDescription constructed from the given
  619. arguments representing a streaming-request/unary-response
  620. RPC method.</p>
  621. </td>
  622. </tr>
  623. </tbody>
  624. </table>
  625. </dd></dl>
  626. <dl class="function">
  627. <dt id="grpc.framework.alpha.utilities.unary_stream_invocation_description">
  628. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">unary_stream_invocation_description</code><span class="sig-paren">(</span><em>request_serializer</em>, <em>response_deserializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#unary_stream_invocation_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.unary_stream_invocation_description" title="Permalink to this definition">¶</a></dt>
  629. <dd><p>Creates an interfaces.RpcMethodInvocationDescription for an RPC method.</p>
  630. <table class="docutils field-list" frame="void" rules="none">
  631. <col class="field-name" />
  632. <col class="field-body" />
  633. <tbody valign="top">
  634. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  635. <li><strong>request_serializer</strong> &#8211; A callable that when called on a request
  636. value returns a bytestring corresponding to that value.</li>
  637. <li><strong>response_deserializer</strong> &#8211; A callable that when called on a
  638. bytestring returns the response value corresponding to
  639. that bytestring.</li>
  640. </ul>
  641. </td>
  642. </tr>
  643. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodInvocationDescription constructed from the given
  644. arguments representing a unary-request/streaming-response RPC method.</p>
  645. </td>
  646. </tr>
  647. </tbody>
  648. </table>
  649. </dd></dl>
  650. <dl class="function">
  651. <dt id="grpc.framework.alpha.utilities.unary_stream_service_description">
  652. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">unary_stream_service_description</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer</em>, <em>response_serializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#unary_stream_service_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.unary_stream_service_description" title="Permalink to this definition">¶</a></dt>
  653. <dd><p>Creates an interfaces.RpcMethodServiceDescription for the given behavior.</p>
  654. <table class="docutils field-list" frame="void" rules="none">
  655. <col class="field-name" />
  656. <col class="field-body" />
  657. <tbody valign="top">
  658. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  659. <li><strong>behavior</strong> &#8211; A callable that implements a unary-stream RPC
  660. method that accepts a single request and an interfaces.RpcContext
  661. and returns an iterator of zero or more responses.</li>
  662. <li><strong>request_deserializer</strong> &#8211; A callable that when called on a
  663. bytestring returns the request value corresponding to that
  664. bytestring.</li>
  665. <li><strong>response_serializer</strong> &#8211; A callable that when called on a
  666. response value returns the bytestring corresponding to
  667. that value.</li>
  668. </ul>
  669. </td>
  670. </tr>
  671. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodServiceDescription constructed from the given
  672. arguments representing a unary-request/streaming-response
  673. RPC method.</p>
  674. </td>
  675. </tr>
  676. </tbody>
  677. </table>
  678. </dd></dl>
  679. <dl class="function">
  680. <dt id="grpc.framework.alpha.utilities.unary_unary_invocation_description">
  681. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">unary_unary_invocation_description</code><span class="sig-paren">(</span><em>request_serializer</em>, <em>response_deserializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#unary_unary_invocation_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.unary_unary_invocation_description" title="Permalink to this definition">¶</a></dt>
  682. <dd><p>Creates an interfaces.RpcMethodInvocationDescription for an RPC method.</p>
  683. <table class="docutils field-list" frame="void" rules="none">
  684. <col class="field-name" />
  685. <col class="field-body" />
  686. <tbody valign="top">
  687. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  688. <li><strong>request_serializer</strong> &#8211; A callable that when called on a request
  689. value returns a bytestring corresponding to that value.</li>
  690. <li><strong>response_deserializer</strong> &#8211; A callable that when called on a
  691. bytestring returns the response value corresponding to
  692. that bytestring.</li>
  693. </ul>
  694. </td>
  695. </tr>
  696. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodInvocationDescription constructed from the given
  697. arguments representing a unary-request/unary-response RPC method.</p>
  698. </td>
  699. </tr>
  700. </tbody>
  701. </table>
  702. </dd></dl>
  703. <dl class="function">
  704. <dt id="grpc.framework.alpha.utilities.unary_unary_service_description">
  705. <code class="descclassname">grpc.framework.alpha.utilities.</code><code class="descname">unary_unary_service_description</code><span class="sig-paren">(</span><em>behavior</em>, <em>request_deserializer</em>, <em>response_serializer</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/alpha/utilities.html#unary_unary_service_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.alpha.utilities.unary_unary_service_description" title="Permalink to this definition">¶</a></dt>
  706. <dd><p>Creates an interfaces.RpcMethodServiceDescription for the given behavior.</p>
  707. <table class="docutils field-list" frame="void" rules="none">
  708. <col class="field-name" />
  709. <col class="field-body" />
  710. <tbody valign="top">
  711. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  712. <li><strong>behavior</strong> &#8211; A callable that implements a unary-unary RPC
  713. method that accepts a single request and an interfaces.RpcContext and
  714. returns a single response.</li>
  715. <li><strong>request_deserializer</strong> &#8211; A callable that when called on a
  716. bytestring returns the request value corresponding to that
  717. bytestring.</li>
  718. <li><strong>response_serializer</strong> &#8211; A callable that when called on a
  719. response value returns the bytestring corresponding to
  720. that value.</li>
  721. </ul>
  722. </td>
  723. </tr>
  724. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An interfaces.RpcMethodServiceDescription constructed from the given
  725. arguments representing a unary-request/unary-response RPC
  726. method.</p>
  727. </td>
  728. </tr>
  729. </tbody>
  730. </table>
  731. </dd></dl>
  732. </div>
  733. <div class="section" id="module-grpc.framework.alpha">
  734. <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc.framework.alpha" title="Permalink to this headline">¶</a></h2>
  735. </div>
  736. </div>
  737. </div>
  738. </div>
  739. <footer>
  740. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  741. <a href="grpc.framework.base.html" class="btn btn-neutral float-right" title="grpc.framework.base package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
  742. <a href="grpc.framework.html" class="btn btn-neutral" title="grpc.framework package" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  743. </div>
  744. <hr/>
  745. <div role="contentinfo">
  746. <p>
  747. &copy; Copyright 2015, Author.
  748. </p>
  749. </div>
  750. 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>.
  751. </footer>
  752. </div>
  753. </div>
  754. </section>
  755. </div>
  756. <script type="text/javascript">
  757. var DOCUMENTATION_OPTIONS = {
  758. URL_ROOT:'./',
  759. VERSION:'0.11.0b1',
  760. COLLAPSE_INDEX:false,
  761. FILE_SUFFIX:'.html',
  762. HAS_SOURCE: true
  763. };
  764. </script>
  765. <script type="text/javascript" src="_static/jquery.js"></script>
  766. <script type="text/javascript" src="_static/underscore.js"></script>
  767. <script type="text/javascript" src="_static/doctools.js"></script>
  768. <script type="text/javascript" src="_static/js/theme.js"></script>
  769. <script type="text/javascript">
  770. jQuery(function () {
  771. SphinxRtdTheme.StickyNav.enable();
  772. });
  773. </script>
  774. </body>
  775. </html>