grpc.framework.interfaces.base.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  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.interfaces.base 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.framework.interfaces package" href="grpc.framework.interfaces.html"/>
  14. <link rel="next" title="grpc.framework.interfaces.face package" href="grpc.framework.interfaces.face.html"/>
  15. <link rel="prev" title="grpc.framework.interfaces package" href="grpc.framework.interfaces.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"><a class="reference internal" href="grpc.beta.html">grpc.beta package</a></li>
  42. <li class="toctree-l3 current"><a class="reference internal" href="grpc.framework.html">grpc.framework package</a><ul class="current">
  43. <li class="toctree-l4 current"><a class="reference internal" href="grpc.framework.html#subpackages">Subpackages</a></li>
  44. <li class="toctree-l4"><a class="reference internal" href="grpc.framework.html#module-grpc.framework">Module contents</a></li>
  45. </ul>
  46. </li>
  47. </ul>
  48. </li>
  49. <li class="toctree-l2"><a class="reference internal" href="grpc.html#module-grpc">Module contents</a></li>
  50. </ul>
  51. </li>
  52. <li class="toctree-l1"><a class="reference internal" href="grpc.html#glossary">Glossary</a></li>
  53. </ul>
  54. </div>
  55. </div>
  56. </nav>
  57. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  58. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  59. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  60. <a href="index.html">grpcio</a>
  61. </nav>
  62. <div class="wy-nav-content">
  63. <div class="rst-content">
  64. <div role="navigation" aria-label="breadcrumbs navigation">
  65. <ul class="wy-breadcrumbs">
  66. <li><a href="index.html">Docs</a> &raquo;</li>
  67. <li><a href="grpc.html">grpc package</a> &raquo;</li>
  68. <li><a href="grpc.framework.html">grpc.framework package</a> &raquo;</li>
  69. <li><a href="grpc.framework.interfaces.html">grpc.framework.interfaces package</a> &raquo;</li>
  70. <li>grpc.framework.interfaces.base package</li>
  71. <li class="wy-breadcrumbs-aside">
  72. <a href="_sources/grpc.framework.interfaces.base.rst.txt" rel="nofollow"> View page source</a>
  73. </li>
  74. </ul>
  75. <hr/>
  76. </div>
  77. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  78. <div itemprop="articleBody">
  79. <div class="section" id="grpc-framework-interfaces-base-package">
  80. <h1>grpc.framework.interfaces.base package<a class="headerlink" href="#grpc-framework-interfaces-base-package" title="Permalink to this headline">¶</a></h1>
  81. <div class="section" id="submodules">
  82. <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
  83. </div>
  84. <div class="section" id="module-grpc.framework.interfaces.base.base">
  85. <span id="grpc-framework-interfaces-base-base-module"></span><h2>grpc.framework.interfaces.base.base module<a class="headerlink" href="#module-grpc.framework.interfaces.base.base" title="Permalink to this headline">¶</a></h2>
  86. <p>The base interface of RPC Framework.</p>
  87. <p>Implementations of this interface support the conduct of &#8220;operations&#8221;:
  88. exchanges between two distinct ends of an arbitrary number of data payloads
  89. and metadata such as a name for the operation, initial and terminal metadata
  90. in each direction, and flow control. These operations may be used for transfers
  91. of data, remote procedure calls, status indication, or anything else
  92. applications choose.</p>
  93. <dl class="class">
  94. <dt id="grpc.framework.interfaces.base.base.Completion">
  95. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">Completion</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Completion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Completion" title="Permalink to this definition">¶</a></dt>
  96. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  97. <p>An aggregate of the values exchanged upon operation completion.</p>
  98. <dl class="attribute">
  99. <dt id="grpc.framework.interfaces.base.base.Completion.terminal_metadata">
  100. <code class="descname">terminal_metadata</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Completion.terminal_metadata" title="Permalink to this definition">¶</a></dt>
  101. <dd><p>A terminal metadata value for the operaton.</p>
  102. </dd></dl>
  103. <dl class="attribute">
  104. <dt id="grpc.framework.interfaces.base.base.Completion.code">
  105. <code class="descname">code</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Completion.code" title="Permalink to this definition">¶</a></dt>
  106. <dd><p>A code value for the operation.</p>
  107. </dd></dl>
  108. <dl class="attribute">
  109. <dt id="grpc.framework.interfaces.base.base.Completion.message">
  110. <code class="descname">message</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Completion.message" title="Permalink to this definition">¶</a></dt>
  111. <dd><p>A message value for the operation.</p>
  112. </dd></dl>
  113. </dd></dl>
  114. <dl class="class">
  115. <dt id="grpc.framework.interfaces.base.base.End">
  116. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">End</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#End"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End" title="Permalink to this definition">¶</a></dt>
  117. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  118. <p>Common type for entry-point objects on both sides of an operation.</p>
  119. <dl class="method">
  120. <dt id="grpc.framework.interfaces.base.base.End.add_idle_action">
  121. <code class="descname">add_idle_action</code><span class="sig-paren">(</span><em>action</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#End.add_idle_action"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End.add_idle_action" title="Permalink to this definition">¶</a></dt>
  122. <dd><p>Adds an action to be called when this End has no ongoing operations.</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>action</strong> &#8211; A callable that accepts no arguments.</td>
  128. </tr>
  129. </tbody>
  130. </table>
  131. </dd></dl>
  132. <dl class="method">
  133. <dt id="grpc.framework.interfaces.base.base.End.operate">
  134. <code class="descname">operate</code><span class="sig-paren">(</span><em>group</em>, <em>method</em>, <em>subscription</em>, <em>timeout</em>, <em>initial_metadata=None</em>, <em>payload=None</em>, <em>completion=None</em>, <em>protocol_options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#End.operate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End.operate" title="Permalink to this definition">¶</a></dt>
  135. <dd><p>Commences an operation.</p>
  136. <table class="docutils field-list" frame="void" rules="none">
  137. <col class="field-name" />
  138. <col class="field-body" />
  139. <tbody valign="top">
  140. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  141. <li><strong>group</strong> &#8211; The group identifier of the invoked operation.</li>
  142. <li><strong>method</strong> &#8211; The method identifier of the invoked operation.</li>
  143. <li><strong>subscription</strong> &#8211; A Subscription to which the results of the operation will be
  144. passed.</li>
  145. <li><strong>timeout</strong> &#8211; A length of time in seconds to allow for the operation.</li>
  146. <li><strong>initial_metadata</strong> &#8211; An initial metadata value to be sent to the other side
  147. of the operation. May be None if the initial metadata will be later
  148. passed via the returned operator or if there will be no initial metadata
  149. passed at all.</li>
  150. <li><strong>payload</strong> &#8211; An initial payload for the operation.</li>
  151. <li><strong>completion</strong> &#8211; A Completion value indicating the end of transmission to the
  152. other side of the operation.</li>
  153. <li><strong>protocol_options</strong> &#8211; A value specified by the provider of a Base interface
  154. implementation affording custom state and behavior.</li>
  155. </ul>
  156. </td>
  157. </tr>
  158. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  159. <dt>A pair of objects affording information about the operation and action</dt>
  160. <dd><p class="first last">continuing the operation. The first element of the returned pair is an
  161. OperationContext for the operation and the second element of the
  162. returned pair is an Operator to which operation values not passed in
  163. this call should later be passed.</p>
  164. </dd>
  165. </dl>
  166. </p>
  167. </td>
  168. </tr>
  169. </tbody>
  170. </table>
  171. </dd></dl>
  172. <dl class="method">
  173. <dt id="grpc.framework.interfaces.base.base.End.operation_stats">
  174. <code class="descname">operation_stats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#End.operation_stats"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End.operation_stats" title="Permalink to this definition">¶</a></dt>
  175. <dd><p>Reports the number of terminated operations broken down by outcome.</p>
  176. <table class="docutils field-list" frame="void" rules="none">
  177. <col class="field-name" />
  178. <col class="field-body" />
  179. <tbody valign="top">
  180. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  181. <dt>A dictionary from Outcome.Kind value to an integer identifying the number</dt>
  182. <dd>of operations that terminated with that outcome kind.</dd>
  183. </dl>
  184. </td>
  185. </tr>
  186. </tbody>
  187. </table>
  188. </dd></dl>
  189. <dl class="method">
  190. <dt id="grpc.framework.interfaces.base.base.End.start">
  191. <code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#End.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End.start" title="Permalink to this definition">¶</a></dt>
  192. <dd><p>Starts this object&#8217;s service of operations.</p>
  193. </dd></dl>
  194. <dl class="method">
  195. <dt id="grpc.framework.interfaces.base.base.End.stop">
  196. <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/framework/interfaces/base/base.html#End.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.End.stop" title="Permalink to this definition">¶</a></dt>
  197. <dd><p>Stops this object&#8217;s service of operations.</p>
  198. <p>This object will refuse service of new operations as soon as this method is
  199. called but operations under way at the time of the call may be given a
  200. grace period during which they are allowed to finish.</p>
  201. <table class="docutils field-list" frame="void" rules="none">
  202. <col class="field-name" />
  203. <col class="field-body" />
  204. <tbody valign="top">
  205. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>grace</strong> &#8211; A duration of time in seconds to allow ongoing operations to
  206. terminate before being forcefully terminated by the stopping of this
  207. End. May be zero to terminate all ongoing operations and immediately
  208. stop.</td>
  209. </tr>
  210. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  211. <dt>A threading.Event that will be set to indicate all operations having</dt>
  212. <dd>terminated and this End having completely stopped. The returned event
  213. may not be set until after the full grace period (if some ongoing
  214. operation continues for the full length of the period) or it may be set
  215. much sooner (if for example this End had no operations in progress at
  216. the time its stop method was called).</dd>
  217. </dl>
  218. </td>
  219. </tr>
  220. </tbody>
  221. </table>
  222. </dd></dl>
  223. </dd></dl>
  224. <dl class="exception">
  225. <dt id="grpc.framework.interfaces.base.base.NoSuchMethodError">
  226. <em class="property">exception </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">NoSuchMethodError</code><span class="sig-paren">(</span><em>code</em>, <em>details</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#NoSuchMethodError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.NoSuchMethodError" title="Permalink to this definition">¶</a></dt>
  227. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
  228. <p>Indicates that an unrecognized operation has been called.</p>
  229. <dl class="attribute">
  230. <dt id="grpc.framework.interfaces.base.base.NoSuchMethodError.code">
  231. <code class="descname">code</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.NoSuchMethodError.code" title="Permalink to this definition">¶</a></dt>
  232. <dd><p>A code value to communicate to the other side of the operation
  233. along with indication of operation termination. May be None.</p>
  234. </dd></dl>
  235. <dl class="attribute">
  236. <dt id="grpc.framework.interfaces.base.base.NoSuchMethodError.details">
  237. <code class="descname">details</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.NoSuchMethodError.details" title="Permalink to this definition">¶</a></dt>
  238. <dd><p>A details value to communicate to the other side of the
  239. operation along with indication of operation termination. May be None.</p>
  240. </dd></dl>
  241. </dd></dl>
  242. <dl class="class">
  243. <dt id="grpc.framework.interfaces.base.base.OperationContext">
  244. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">OperationContext</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext" title="Permalink to this definition">¶</a></dt>
  245. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  246. <p>Provides operation-related information and action.</p>
  247. <dl class="method">
  248. <dt id="grpc.framework.interfaces.base.base.OperationContext.add_termination_callback">
  249. <code class="descname">add_termination_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext.add_termination_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext.add_termination_callback" title="Permalink to this definition">¶</a></dt>
  250. <dd><p>Adds a function to be called upon operation termination.</p>
  251. <table class="docutils field-list" frame="void" rules="none">
  252. <col class="field-name" />
  253. <col class="field-body" />
  254. <tbody valign="top">
  255. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> &#8211; A callable to be passed an Outcome value on operation
  256. termination.</td>
  257. </tr>
  258. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  259. <dt>None if the operation has not yet terminated and the passed callback will</dt>
  260. <dd>later be called when it does terminate, or if the operation has already
  261. terminated an Outcome value describing the operation termination and the
  262. passed callback will not be called as a result of this method call.</dd>
  263. </dl>
  264. </td>
  265. </tr>
  266. </tbody>
  267. </table>
  268. </dd></dl>
  269. <dl class="method">
  270. <dt id="grpc.framework.interfaces.base.base.OperationContext.cancel">
  271. <code class="descname">cancel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext.cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext.cancel" title="Permalink to this definition">¶</a></dt>
  272. <dd><p>Cancels the operation if the operation has not yet terminated.</p>
  273. </dd></dl>
  274. <dl class="method">
  275. <dt id="grpc.framework.interfaces.base.base.OperationContext.fail">
  276. <code class="descname">fail</code><span class="sig-paren">(</span><em>exception</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext.fail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext.fail" title="Permalink to this definition">¶</a></dt>
  277. <dd><p>Indicates that the operation has failed.</p>
  278. <table class="docutils field-list" frame="void" rules="none">
  279. <col class="field-name" />
  280. <col class="field-body" />
  281. <tbody valign="top">
  282. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>exception</strong> &#8211; An exception germane to the operation failure. May be None.</td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. </dd></dl>
  287. <dl class="method">
  288. <dt id="grpc.framework.interfaces.base.base.OperationContext.outcome">
  289. <code class="descname">outcome</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext.outcome"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext.outcome" title="Permalink to this definition">¶</a></dt>
  290. <dd><p>Indicates the operation&#8217;s outcome (or that the operation is ongoing).</p>
  291. <table class="docutils field-list" frame="void" rules="none">
  292. <col class="field-name" />
  293. <col class="field-body" />
  294. <tbody valign="top">
  295. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
  296. <dt>None if the operation is still active or the Outcome value for the</dt>
  297. <dd>operation if it has terminated.</dd>
  298. </dl>
  299. </td>
  300. </tr>
  301. </tbody>
  302. </table>
  303. </dd></dl>
  304. <dl class="method">
  305. <dt id="grpc.framework.interfaces.base.base.OperationContext.time_remaining">
  306. <code class="descname">time_remaining</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#OperationContext.time_remaining"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.OperationContext.time_remaining" title="Permalink to this definition">¶</a></dt>
  307. <dd><p>Describes the length of allowed time remaining for the operation.</p>
  308. <table class="docutils field-list" frame="void" rules="none">
  309. <col class="field-name" />
  310. <col class="field-body" />
  311. <tbody valign="top">
  312. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A nonnegative float indicating the length of allowed time in seconds
  313. remaining for the operation to complete before it is considered to have
  314. timed out. Zero is returned if the operation has terminated.</td>
  315. </tr>
  316. </tbody>
  317. </table>
  318. </dd></dl>
  319. </dd></dl>
  320. <dl class="class">
  321. <dt id="grpc.framework.interfaces.base.base.Operator">
  322. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">Operator</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Operator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Operator" title="Permalink to this definition">¶</a></dt>
  323. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  324. <p>An interface through which to participate in an operation.</p>
  325. <dl class="method">
  326. <dt id="grpc.framework.interfaces.base.base.Operator.advance">
  327. <code class="descname">advance</code><span class="sig-paren">(</span><em>initial_metadata=None</em>, <em>payload=None</em>, <em>completion=None</em>, <em>allowance=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Operator.advance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Operator.advance" title="Permalink to this definition">¶</a></dt>
  328. <dd><p>Progresses the operation.</p>
  329. <table class="docutils field-list" frame="void" rules="none">
  330. <col class="field-name" />
  331. <col class="field-body" />
  332. <tbody valign="top">
  333. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  334. <li><strong>initial_metadata</strong> &#8211; An initial metadata value. Only one may ever be
  335. communicated in each direction for an operation, and they must be
  336. communicated no later than either the first payload or the completion.</li>
  337. <li><strong>payload</strong> &#8211; A payload value.</li>
  338. <li><strong>completion</strong> &#8211; A Completion value. May only ever be non-None once in either
  339. direction, and no payloads may be passed after it has been communicated.</li>
  340. <li><strong>allowance</strong> &#8211; A positive integer communicating the number of additional
  341. payloads allowed to be passed by the remote side of the operation.</li>
  342. </ul>
  343. </td>
  344. </tr>
  345. </tbody>
  346. </table>
  347. </dd></dl>
  348. </dd></dl>
  349. <dl class="class">
  350. <dt id="grpc.framework.interfaces.base.base.Outcome">
  351. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">Outcome</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Outcome"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome" title="Permalink to this definition">¶</a></dt>
  352. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  353. <p>The outcome of an operation.</p>
  354. <dl class="attribute">
  355. <dt id="grpc.framework.interfaces.base.base.Outcome.kind">
  356. <code class="descname">kind</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.kind" title="Permalink to this definition">¶</a></dt>
  357. <dd><p>A Kind value coarsely identifying how the operation terminated.</p>
  358. </dd></dl>
  359. <dl class="attribute">
  360. <dt id="grpc.framework.interfaces.base.base.Outcome.code">
  361. <code class="descname">code</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.code" title="Permalink to this definition">¶</a></dt>
  362. <dd><p>An application-specific code value or None if no such value was
  363. provided.</p>
  364. </dd></dl>
  365. <dl class="attribute">
  366. <dt id="grpc.framework.interfaces.base.base.Outcome.details">
  367. <code class="descname">details</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.details" title="Permalink to this definition">¶</a></dt>
  368. <dd><p>An application-specific details value or None if no such value was
  369. provided.</p>
  370. </dd></dl>
  371. <dl class="class">
  372. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind">
  373. <em class="property">class </em><code class="descname">Kind</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Outcome.Kind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind" title="Permalink to this definition">¶</a></dt>
  374. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  375. <p>Ways in which an operation can terminate.</p>
  376. <dl class="attribute">
  377. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.CANCELLED">
  378. <code class="descname">CANCELLED</code><em class="property"> = 'cancelled'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.CANCELLED" title="Permalink to this definition">¶</a></dt>
  379. <dd></dd></dl>
  380. <dl class="attribute">
  381. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.COMPLETED">
  382. <code class="descname">COMPLETED</code><em class="property"> = 'completed'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.COMPLETED" title="Permalink to this definition">¶</a></dt>
  383. <dd></dd></dl>
  384. <dl class="attribute">
  385. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.EXPIRED">
  386. <code class="descname">EXPIRED</code><em class="property"> = 'expired'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.EXPIRED" title="Permalink to this definition">¶</a></dt>
  387. <dd></dd></dl>
  388. <dl class="attribute">
  389. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.LOCAL_FAILURE">
  390. <code class="descname">LOCAL_FAILURE</code><em class="property"> = 'local failure'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.LOCAL_FAILURE" title="Permalink to this definition">¶</a></dt>
  391. <dd></dd></dl>
  392. <dl class="attribute">
  393. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.LOCAL_SHUTDOWN">
  394. <code class="descname">LOCAL_SHUTDOWN</code><em class="property"> = 'local shutdown'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.LOCAL_SHUTDOWN" title="Permalink to this definition">¶</a></dt>
  395. <dd></dd></dl>
  396. <dl class="attribute">
  397. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.RECEPTION_FAILURE">
  398. <code class="descname">RECEPTION_FAILURE</code><em class="property"> = 'reception failure'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.RECEPTION_FAILURE" title="Permalink to this definition">¶</a></dt>
  399. <dd></dd></dl>
  400. <dl class="attribute">
  401. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.REMOTE_FAILURE">
  402. <code class="descname">REMOTE_FAILURE</code><em class="property"> = 'remote failure'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.REMOTE_FAILURE" title="Permalink to this definition">¶</a></dt>
  403. <dd></dd></dl>
  404. <dl class="attribute">
  405. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.REMOTE_SHUTDOWN">
  406. <code class="descname">REMOTE_SHUTDOWN</code><em class="property"> = 'remote shutdown'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.REMOTE_SHUTDOWN" title="Permalink to this definition">¶</a></dt>
  407. <dd></dd></dl>
  408. <dl class="attribute">
  409. <dt id="grpc.framework.interfaces.base.base.Outcome.Kind.TRANSMISSION_FAILURE">
  410. <code class="descname">TRANSMISSION_FAILURE</code><em class="property"> = 'transmission failure'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Outcome.Kind.TRANSMISSION_FAILURE" title="Permalink to this definition">¶</a></dt>
  411. <dd></dd></dl>
  412. </dd></dl>
  413. </dd></dl>
  414. <dl class="class">
  415. <dt id="grpc.framework.interfaces.base.base.ProtocolReceiver">
  416. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">ProtocolReceiver</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#ProtocolReceiver"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.ProtocolReceiver" title="Permalink to this definition">¶</a></dt>
  417. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  418. <p>A means of receiving protocol values during an operation.</p>
  419. <dl class="method">
  420. <dt id="grpc.framework.interfaces.base.base.ProtocolReceiver.context">
  421. <code class="descname">context</code><span class="sig-paren">(</span><em>protocol_context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#ProtocolReceiver.context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.ProtocolReceiver.context" title="Permalink to this definition">¶</a></dt>
  422. <dd><p>Accepts the protocol context object for the operation.</p>
  423. <table class="docutils field-list" frame="void" rules="none">
  424. <col class="field-name" />
  425. <col class="field-body" />
  426. <tbody valign="top">
  427. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>protocol_context</strong> &#8211; The protocol context object for the operation.</td>
  428. </tr>
  429. </tbody>
  430. </table>
  431. </dd></dl>
  432. </dd></dl>
  433. <dl class="class">
  434. <dt id="grpc.framework.interfaces.base.base.Servicer">
  435. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">Servicer</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Servicer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Servicer" title="Permalink to this definition">¶</a></dt>
  436. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  437. <p>Interface for service implementations.</p>
  438. <dl class="method">
  439. <dt id="grpc.framework.interfaces.base.base.Servicer.service">
  440. <code class="descname">service</code><span class="sig-paren">(</span><em>group</em>, <em>method</em>, <em>context</em>, <em>output_operator</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Servicer.service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Servicer.service" title="Permalink to this definition">¶</a></dt>
  441. <dd><p>Services an operation.</p>
  442. <table class="docutils field-list" frame="void" rules="none">
  443. <col class="field-name" />
  444. <col class="field-body" />
  445. <tbody valign="top">
  446. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  447. <li><strong>group</strong> &#8211; The group identifier of the operation to be serviced.</li>
  448. <li><strong>method</strong> &#8211; The method identifier of the operation to be serviced.</li>
  449. <li><strong>context</strong> &#8211; An OperationContext object affording contextual information and
  450. actions.</li>
  451. <li><strong>output_operator</strong> &#8211; An Operator that will accept output values of the
  452. operation.</li>
  453. </ul>
  454. </td>
  455. </tr>
  456. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
  457. <dt>A Subscription via which this object may or may not accept more values of</dt>
  458. <dd><p class="first last">the operation.</p>
  459. </dd>
  460. </dl>
  461. </p>
  462. </td>
  463. </tr>
  464. <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
  465. <li><a class="reference internal" href="#grpc.framework.interfaces.base.base.NoSuchMethodError" title="grpc.framework.interfaces.base.base.NoSuchMethodError"><code class="xref py py-exc docutils literal"><span class="pre">NoSuchMethodError</span></code></a> &#8211; If this Servicer does not handle operations with the
  466. given group and method.</li>
  467. <li><code class="xref py py-exc docutils literal"><span class="pre">abandonment.Abandoned</span></code> &#8211; If the operation has been aborted and there no
  468. longer is any reason to service the operation.</li>
  469. </ul>
  470. </td>
  471. </tr>
  472. </tbody>
  473. </table>
  474. </dd></dl>
  475. </dd></dl>
  476. <dl class="class">
  477. <dt id="grpc.framework.interfaces.base.base.Subscription">
  478. <em class="property">class </em><code class="descclassname">grpc.framework.interfaces.base.base.</code><code class="descname">Subscription</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Subscription"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription" title="Permalink to this definition">¶</a></dt>
  479. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
  480. <p>Describes customer code&#8217;s interest in values from the other side.</p>
  481. <dl class="attribute">
  482. <dt id="grpc.framework.interfaces.base.base.Subscription.kind">
  483. <code class="descname">kind</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.kind" title="Permalink to this definition">¶</a></dt>
  484. <dd><p>A Kind value describing the overall kind of this value.</p>
  485. </dd></dl>
  486. <dl class="attribute">
  487. <dt id="grpc.framework.interfaces.base.base.Subscription.termination_callback">
  488. <code class="descname">termination_callback</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.termination_callback" title="Permalink to this definition">¶</a></dt>
  489. <dd><p>A callable to be passed the Outcome associated with
  490. the operation after it has terminated. Must be non-None if kind is
  491. Kind.TERMINATION_ONLY. Must be None otherwise.</p>
  492. </dd></dl>
  493. <dl class="attribute">
  494. <dt id="grpc.framework.interfaces.base.base.Subscription.allowance">
  495. <code class="descname">allowance</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.allowance" title="Permalink to this definition">¶</a></dt>
  496. <dd><p>A callable behavior that accepts positive integers representing
  497. the number of additional payloads allowed to be passed to the other side
  498. of the operation. Must be None if kind is Kind.FULL. Must not be None
  499. otherwise.</p>
  500. </dd></dl>
  501. <dl class="attribute">
  502. <dt id="grpc.framework.interfaces.base.base.Subscription.operator">
  503. <code class="descname">operator</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.operator" title="Permalink to this definition">¶</a></dt>
  504. <dd><p>An Operator to be passed values from the other side of the
  505. operation. Must be non-None if kind is Kind.FULL. Must be None otherwise.</p>
  506. </dd></dl>
  507. <dl class="attribute">
  508. <dt id="grpc.framework.interfaces.base.base.Subscription.protocol_receiver">
  509. <code class="descname">protocol_receiver</code><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.protocol_receiver" title="Permalink to this definition">¶</a></dt>
  510. <dd><p>A ProtocolReceiver to be passed protocol objects as they
  511. become available during the operation. Must be non-None if kind is
  512. Kind.FULL.</p>
  513. </dd></dl>
  514. <dl class="class">
  515. <dt id="grpc.framework.interfaces.base.base.Subscription.Kind">
  516. <em class="property">class </em><code class="descname">Kind</code><a class="reference internal" href="_modules/grpc/framework/interfaces/base/base.html#Subscription.Kind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.Kind" title="Permalink to this definition">¶</a></dt>
  517. <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">enum.Enum</span></code></p>
  518. <dl class="attribute">
  519. <dt id="grpc.framework.interfaces.base.base.Subscription.Kind.FULL">
  520. <code class="descname">FULL</code><em class="property"> = 'full'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.Kind.FULL" title="Permalink to this definition">¶</a></dt>
  521. <dd></dd></dl>
  522. <dl class="attribute">
  523. <dt id="grpc.framework.interfaces.base.base.Subscription.Kind.NONE">
  524. <code class="descname">NONE</code><em class="property"> = 'none'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.Kind.NONE" title="Permalink to this definition">¶</a></dt>
  525. <dd></dd></dl>
  526. <dl class="attribute">
  527. <dt id="grpc.framework.interfaces.base.base.Subscription.Kind.TERMINATION_ONLY">
  528. <code class="descname">TERMINATION_ONLY</code><em class="property"> = 'termination only'</em><a class="headerlink" href="#grpc.framework.interfaces.base.base.Subscription.Kind.TERMINATION_ONLY" title="Permalink to this definition">¶</a></dt>
  529. <dd></dd></dl>
  530. </dd></dl>
  531. </dd></dl>
  532. </div>
  533. <div class="section" id="module-grpc.framework.interfaces.base.utilities">
  534. <span id="grpc-framework-interfaces-base-utilities-module"></span><h2>grpc.framework.interfaces.base.utilities module<a class="headerlink" href="#module-grpc.framework.interfaces.base.utilities" title="Permalink to this headline">¶</a></h2>
  535. <p>Utilities for use with the base interface of RPC Framework.</p>
  536. <dl class="function">
  537. <dt id="grpc.framework.interfaces.base.utilities.completion">
  538. <code class="descclassname">grpc.framework.interfaces.base.utilities.</code><code class="descname">completion</code><span class="sig-paren">(</span><em>terminal_metadata</em>, <em>code</em>, <em>message</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/utilities.html#completion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.utilities.completion" title="Permalink to this definition">¶</a></dt>
  539. <dd><p>Creates a base.Completion aggregating the given operation values.</p>
  540. <table class="docutils field-list" frame="void" rules="none">
  541. <col class="field-name" />
  542. <col class="field-body" />
  543. <tbody valign="top">
  544. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  545. <li><strong>terminal_metadata</strong> &#8211; A terminal metadata value for an operaton.</li>
  546. <li><strong>code</strong> &#8211; A code value for an operation.</li>
  547. <li><strong>message</strong> &#8211; A message value for an operation.</li>
  548. </ul>
  549. </td>
  550. </tr>
  551. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A base.Completion aggregating the given operation values.</p>
  552. </td>
  553. </tr>
  554. </tbody>
  555. </table>
  556. </dd></dl>
  557. <dl class="function">
  558. <dt id="grpc.framework.interfaces.base.utilities.full_subscription">
  559. <code class="descclassname">grpc.framework.interfaces.base.utilities.</code><code class="descname">full_subscription</code><span class="sig-paren">(</span><em>operator</em>, <em>protocol_receiver</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc/framework/interfaces/base/utilities.html#full_subscription"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#grpc.framework.interfaces.base.utilities.full_subscription" title="Permalink to this definition">¶</a></dt>
  560. <dd><p>Creates a &#8220;full&#8221; base.Subscription for the given base.Operator.</p>
  561. <table class="docutils field-list" frame="void" rules="none">
  562. <col class="field-name" />
  563. <col class="field-body" />
  564. <tbody valign="top">
  565. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  566. <li><strong>operator</strong> &#8211; A base.Operator to be used in an operation.</li>
  567. <li><strong>protocol_receiver</strong> &#8211; A base.ProtocolReceiver to be used in an operation.</li>
  568. </ul>
  569. </td>
  570. </tr>
  571. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><dl class="docutils">
  572. <dt>A base.Subscription of kind base.Subscription.Kind.FULL wrapping the given</dt>
  573. <dd><p class="first last">base.Operator and base.ProtocolReceiver.</p>
  574. </dd>
  575. </dl>
  576. </p>
  577. </td>
  578. </tr>
  579. </tbody>
  580. </table>
  581. </dd></dl>
  582. </div>
  583. <div class="section" id="module-grpc.framework.interfaces.base">
  584. <span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-grpc.framework.interfaces.base" title="Permalink to this headline">¶</a></h2>
  585. </div>
  586. </div>
  587. </div>
  588. <div class="articleComments">
  589. </div>
  590. </div>
  591. <footer>
  592. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  593. <a href="grpc.framework.interfaces.face.html" class="btn btn-neutral float-right" title="grpc.framework.interfaces.face package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
  594. <a href="grpc.framework.interfaces.html" class="btn btn-neutral" title="grpc.framework.interfaces package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  595. </div>
  596. <hr/>
  597. <div role="contentinfo">
  598. <p>
  599. &copy; Copyright 2016, The gRPC Authors.
  600. </p>
  601. </div>
  602. 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>.
  603. </footer>
  604. </div>
  605. </div>
  606. </section>
  607. </div>
  608. <script type="text/javascript">
  609. var DOCUMENTATION_OPTIONS = {
  610. URL_ROOT:'./',
  611. VERSION:'1.2.0',
  612. COLLAPSE_INDEX:false,
  613. FILE_SUFFIX:'.html',
  614. HAS_SOURCE: true,
  615. SOURCELINK_SUFFIX: '.txt'
  616. };
  617. </script>
  618. <script type="text/javascript" src="_static/jquery.js"></script>
  619. <script type="text/javascript" src="_static/underscore.js"></script>
  620. <script type="text/javascript" src="_static/doctools.js"></script>
  621. <script type="text/javascript" src="_static/js/theme.js"></script>
  622. <script type="text/javascript">
  623. jQuery(function () {
  624. SphinxRtdTheme.StickyNav.enable();
  625. });
  626. </script>
  627. </body>
  628. </html>