Grpc.Core.IAsyncStreamReader-1.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Interface IAsyncStreamReader&lt;T&gt;
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Interface IAsyncStreamReader&lt;T&gt;
  11. | gRPC for .NET ">
  12. <meta name="generator" content="docfx 2.36.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Grpc.Core.IAsyncStreamReader`1">
  73. <h1 id="Grpc_Core_IAsyncStreamReader_1" data-uid="Grpc.Core.IAsyncStreamReader`1" class="text-break">Interface IAsyncStreamReader&lt;T&gt;
  74. </h1>
  75. <div class="markdown level0 summary"><p>A stream of messages to be read.
  76. Messages can be awaited <code>await reader.MoveNext()</code>, that returns <code>true</code>
  77. if there is a message available and <code>false</code> if there are no more messages
  78. (i.e. the stream has been closed).
  79. <p>
  80. On the client side, the last invocation of <code>MoveNext()</code> either returns <code>false</code>
  81. if the call has finished successfully or throws <code>RpcException</code> if call finished
  82. with an error. Once the call finishes, subsequent invocations of <code>MoveNext()</code> will
  83. continue yielding the same result (returning <code>false</code> or throwing an exception).
  84. </p>
  85. <p>
  86. On the server side, <code>MoveNext()</code> does not throw exceptions.
  87. In case of a failure, the request stream will appear to be finished
  88. (<code>MoveNext</code> will return <code>false</code>) and the <code>CancellationToken</code>
  89. associated with the call will be cancelled to signal the failure.
  90. </p>
  91. <p>
  92. <code>MoveNext()</code> operations can be cancelled via a cancellation token. Cancelling
  93. an individual read operation has the same effect as cancelling the entire call
  94. (which will also result in the read operation returning prematurely), but the per-read cancellation
  95. tokens passed to MoveNext() only result in cancelling the call if the read operation haven&apos;t finished
  96. yet.
  97. </p></p>
  98. </div>
  99. <div class="markdown level0 conceptual"></div>
  100. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  101. <h6><strong>Assembly</strong>: Grpc.Core.Api.dll</h6>
  102. <h5 id="Grpc_Core_IAsyncStreamReader_1_syntax">Syntax</h5>
  103. <div class="codewrapper">
  104. <pre><code class="lang-csharp hljs">public interface IAsyncStreamReader&lt;T&gt;</code></pre>
  105. </div>
  106. <h5 class="typeParameters">Type Parameters</h5>
  107. <table class="table table-bordered table-striped table-condensed">
  108. <thead>
  109. <tr>
  110. <th>Name</th>
  111. <th>Description</th>
  112. </tr>
  113. </thead>
  114. <tbody>
  115. <tr>
  116. <td><span class="parametername">T</span></td>
  117. <td><p>The message type.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <h3 id="properties">Properties
  123. </h3>
  124. <a id="Grpc_Core_IAsyncStreamReader_1_Current_" data-uid="Grpc.Core.IAsyncStreamReader`1.Current*"></a>
  125. <h4 id="Grpc_Core_IAsyncStreamReader_1_Current" data-uid="Grpc.Core.IAsyncStreamReader`1.Current">Current</h4>
  126. <div class="markdown level1 summary"><p>Gets the current element in the iteration.</p>
  127. </div>
  128. <div class="markdown level1 conceptual"></div>
  129. <h5 class="decalaration">Declaration</h5>
  130. <div class="codewrapper">
  131. <pre><code class="lang-csharp hljs">T Current { get; }</code></pre>
  132. </div>
  133. <h5 class="propertyValue">Property Value</h5>
  134. <table class="table table-bordered table-striped table-condensed">
  135. <thead>
  136. <tr>
  137. <th>Type</th>
  138. <th>Description</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. <tr>
  143. <td><span class="xref">T</span></td>
  144. <td></td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. <h3 id="methods">Methods
  149. </h3>
  150. <a id="Grpc_Core_IAsyncStreamReader_1_MoveNext_" data-uid="Grpc.Core.IAsyncStreamReader`1.MoveNext*"></a>
  151. <h4 id="Grpc_Core_IAsyncStreamReader_1_MoveNext_CancellationToken_" data-uid="Grpc.Core.IAsyncStreamReader`1.MoveNext(CancellationToken)">MoveNext(CancellationToken)</h4>
  152. <div class="markdown level1 summary"><p>Advances the reader to the next element in the sequence, returning the result asynchronously.</p>
  153. </div>
  154. <div class="markdown level1 conceptual"></div>
  155. <h5 class="decalaration">Declaration</h5>
  156. <div class="codewrapper">
  157. <pre><code class="lang-csharp hljs">Task&lt;bool&gt; MoveNext(CancellationToken cancellationToken)</code></pre>
  158. </div>
  159. <h5 class="parameters">Parameters</h5>
  160. <table class="table table-bordered table-striped table-condensed">
  161. <thead>
  162. <tr>
  163. <th>Type</th>
  164. <th>Name</th>
  165. <th>Description</th>
  166. </tr>
  167. </thead>
  168. <tbody>
  169. <tr>
  170. <td><span class="xref">CancellationToken</span></td>
  171. <td><span class="parametername">cancellationToken</span></td>
  172. <td><p>Cancellation token that can be used to cancel the operation.</p>
  173. </td>
  174. </tr>
  175. </tbody>
  176. </table>
  177. <h5 class="returns">Returns</h5>
  178. <table class="table table-bordered table-striped table-condensed">
  179. <thead>
  180. <tr>
  181. <th>Type</th>
  182. <th>Description</th>
  183. </tr>
  184. </thead>
  185. <tbody>
  186. <tr>
  187. <td><span class="xref">Task</span>&lt;<span class="xref">System.Boolean</span>&gt;</td>
  188. <td><p>Task containing the result of the operation: true if the reader was successfully advanced
  189. to the next element; false if the reader has passed the end of the sequence.</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. </article>
  195. </div>
  196. <div class="hidden-sm col-md-2" role="complementary">
  197. <div class="sideaffix">
  198. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  199. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  200. </nav>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. <footer>
  206. <div class="grad-bottom"></div>
  207. <div class="footer">
  208. <div class="container">
  209. <span class="pull-right">
  210. <a href="#top">Back to top</a>
  211. </span>
  212. <span>Generated by <strong>DocFX</strong></span>
  213. </div>
  214. </div>
  215. </footer>
  216. </div>
  217. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  218. <script type="text/javascript" src="../styles/docfx.js"></script>
  219. <script type="text/javascript" src="../styles/main.js"></script>
  220. </body>
  221. </html>