Grpc.Core.Calls.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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>Class Calls
  8. | gRPC C# </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Calls
  11. | gRPC C# ">
  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.Calls">
  73. <h1 id="Grpc_Core_Calls" data-uid="Grpc.Core.Calls" class="text-break">Class Calls
  74. </h1>
  75. <div class="markdown level0 summary"><p>Helper methods for generated clients to make RPC calls.
  76. Most users will use this class only indirectly and will be
  77. making calls using client object generated from protocol
  78. buffer definition files.</p>
  79. </div>
  80. <div class="markdown level0 conceptual"></div>
  81. <div class="inheritance">
  82. <h5>Inheritance</h5>
  83. <div class="level0"><span class="xref">System.Object</span></div>
  84. <div class="level1"><span class="xref">Calls</span></div>
  85. </div>
  86. <div class="inheritedMembers">
  87. <h5>Inherited Members</h5>
  88. <div>
  89. <span class="xref">System.Object.Equals(System.Object)</span>
  90. </div>
  91. <div>
  92. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  93. </div>
  94. <div>
  95. <span class="xref">System.Object.GetHashCode()</span>
  96. </div>
  97. <div>
  98. <span class="xref">System.Object.GetType()</span>
  99. </div>
  100. <div>
  101. <span class="xref">System.Object.MemberwiseClone()</span>
  102. </div>
  103. <div>
  104. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  105. </div>
  106. <div>
  107. <span class="xref">System.Object.ToString()</span>
  108. </div>
  109. </div>
  110. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  111. <h6><strong>Assembly</strong>: Grpc.Core.dll</h6>
  112. <h5 id="Grpc_Core_Calls_syntax">Syntax</h5>
  113. <div class="codewrapper">
  114. <pre><code class="lang-csharp hljs">public static class Calls</code></pre>
  115. </div>
  116. <h3 id="methods">Methods
  117. </h3>
  118. <a id="Grpc_Core_Calls_AsyncClientStreamingCall_" data-uid="Grpc.Core.Calls.AsyncClientStreamingCall*"></a>
  119. <h4 id="Grpc_Core_Calls_AsyncClientStreamingCall__2_Grpc_Core_CallInvocationDetails___0___1__" data-uid="Grpc.Core.Calls.AsyncClientStreamingCall``2(Grpc.Core.CallInvocationDetails{``0,``1})">AsyncClientStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt;)</h4>
  120. <div class="markdown level1 summary"><p>Invokes a client streaming call asynchronously.
  121. In client streaming scenario, client sends a stream of requests and server responds with a single response.</p>
  122. </div>
  123. <div class="markdown level1 conceptual"></div>
  124. <h5 class="decalaration">Declaration</h5>
  125. <div class="codewrapper">
  126. <pre><code class="lang-csharp hljs">public static AsyncClientStreamingCall&lt;TRequest, TResponse&gt; AsyncClientStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt; call)
  127. where TRequest : class where TResponse : class</code></pre>
  128. </div>
  129. <h5 class="parameters">Parameters</h5>
  130. <table class="table table-bordered table-striped table-condensed">
  131. <thead>
  132. <tr>
  133. <th>Type</th>
  134. <th>Name</th>
  135. <th>Description</th>
  136. </tr>
  137. </thead>
  138. <tbody>
  139. <tr>
  140. <td><a class="xref" href="Grpc.Core.CallInvocationDetails-2.html">CallInvocationDetails</a>&lt;TRequest, TResponse&gt;</td>
  141. <td><span class="parametername">call</span></td>
  142. <td><p>The call definition.</p>
  143. </td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. <h5 class="returns">Returns</h5>
  148. <table class="table table-bordered table-striped table-condensed">
  149. <thead>
  150. <tr>
  151. <th>Type</th>
  152. <th>Description</th>
  153. </tr>
  154. </thead>
  155. <tbody>
  156. <tr>
  157. <td><a class="xref" href="Grpc.Core.AsyncClientStreamingCall-2.html">AsyncClientStreamingCall</a>&lt;TRequest, TResponse&gt;</td>
  158. <td><p>An awaitable call object providing access to the response.</p>
  159. </td>
  160. </tr>
  161. </tbody>
  162. </table>
  163. <h5 class="typeParameters">Type Parameters</h5>
  164. <table class="table table-bordered table-striped table-condensed">
  165. <thead>
  166. <tr>
  167. <th>Name</th>
  168. <th>Description</th>
  169. </tr>
  170. </thead>
  171. <tbody>
  172. <tr>
  173. <td><span class="parametername">TRequest</span></td>
  174. <td><p>Type of request messages.</p>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td><span class="parametername">TResponse</span></td>
  179. <td><p>The of response message.</p>
  180. </td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. <a id="Grpc_Core_Calls_AsyncDuplexStreamingCall_" data-uid="Grpc.Core.Calls.AsyncDuplexStreamingCall*"></a>
  185. <h4 id="Grpc_Core_Calls_AsyncDuplexStreamingCall__2_Grpc_Core_CallInvocationDetails___0___1__" data-uid="Grpc.Core.Calls.AsyncDuplexStreamingCall``2(Grpc.Core.CallInvocationDetails{``0,``1})">AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt;)</h4>
  186. <div class="markdown level1 summary"><p>Invokes a duplex streaming call asynchronously.
  187. In duplex streaming scenario, client sends a stream of requests and server responds with a stream of responses.
  188. The response stream is completely independent and both side can be sending messages at the same time.</p>
  189. </div>
  190. <div class="markdown level1 conceptual"></div>
  191. <h5 class="decalaration">Declaration</h5>
  192. <div class="codewrapper">
  193. <pre><code class="lang-csharp hljs">public static AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt; AsyncDuplexStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt; call)
  194. where TRequest : class where TResponse : class</code></pre>
  195. </div>
  196. <h5 class="parameters">Parameters</h5>
  197. <table class="table table-bordered table-striped table-condensed">
  198. <thead>
  199. <tr>
  200. <th>Type</th>
  201. <th>Name</th>
  202. <th>Description</th>
  203. </tr>
  204. </thead>
  205. <tbody>
  206. <tr>
  207. <td><a class="xref" href="Grpc.Core.CallInvocationDetails-2.html">CallInvocationDetails</a>&lt;TRequest, TResponse&gt;</td>
  208. <td><span class="parametername">call</span></td>
  209. <td><p>The call definition.</p>
  210. </td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <h5 class="returns">Returns</h5>
  215. <table class="table table-bordered table-striped table-condensed">
  216. <thead>
  217. <tr>
  218. <th>Type</th>
  219. <th>Description</th>
  220. </tr>
  221. </thead>
  222. <tbody>
  223. <tr>
  224. <td><a class="xref" href="Grpc.Core.AsyncDuplexStreamingCall-2.html">AsyncDuplexStreamingCall</a>&lt;TRequest, TResponse&gt;</td>
  225. <td><p>A call object providing access to the asynchronous request and response streams.</p>
  226. </td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. <h5 class="typeParameters">Type Parameters</h5>
  231. <table class="table table-bordered table-striped table-condensed">
  232. <thead>
  233. <tr>
  234. <th>Name</th>
  235. <th>Description</th>
  236. </tr>
  237. </thead>
  238. <tbody>
  239. <tr>
  240. <td><span class="parametername">TRequest</span></td>
  241. <td><p>Type of request messages.</p>
  242. </td>
  243. </tr>
  244. <tr>
  245. <td><span class="parametername">TResponse</span></td>
  246. <td><p>Type of responsemessages.</p>
  247. </td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <a id="Grpc_Core_Calls_AsyncServerStreamingCall_" data-uid="Grpc.Core.Calls.AsyncServerStreamingCall*"></a>
  252. <h4 id="Grpc_Core_Calls_AsyncServerStreamingCall__2_Grpc_Core_CallInvocationDetails___0___1____0_" data-uid="Grpc.Core.Calls.AsyncServerStreamingCall``2(Grpc.Core.CallInvocationDetails{``0,``1},``0)">AsyncServerStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt;, TRequest)</h4>
  253. <div class="markdown level1 summary"><p>Invokes a server streaming call asynchronously.
  254. In server streaming scenario, client sends on request and server responds with a stream of responses.</p>
  255. </div>
  256. <div class="markdown level1 conceptual"></div>
  257. <h5 class="decalaration">Declaration</h5>
  258. <div class="codewrapper">
  259. <pre><code class="lang-csharp hljs">public static AsyncServerStreamingCall&lt;TResponse&gt; AsyncServerStreamingCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt; call, TRequest req)
  260. where TRequest : class where TResponse : class</code></pre>
  261. </div>
  262. <h5 class="parameters">Parameters</h5>
  263. <table class="table table-bordered table-striped table-condensed">
  264. <thead>
  265. <tr>
  266. <th>Type</th>
  267. <th>Name</th>
  268. <th>Description</th>
  269. </tr>
  270. </thead>
  271. <tbody>
  272. <tr>
  273. <td><a class="xref" href="Grpc.Core.CallInvocationDetails-2.html">CallInvocationDetails</a>&lt;TRequest, TResponse&gt;</td>
  274. <td><span class="parametername">call</span></td>
  275. <td><p>The call definition.</p>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td><span class="xref">TRequest</span></td>
  280. <td><span class="parametername">req</span></td>
  281. <td><p>Request message.</p>
  282. </td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. <h5 class="returns">Returns</h5>
  287. <table class="table table-bordered table-striped table-condensed">
  288. <thead>
  289. <tr>
  290. <th>Type</th>
  291. <th>Description</th>
  292. </tr>
  293. </thead>
  294. <tbody>
  295. <tr>
  296. <td><a class="xref" href="Grpc.Core.AsyncServerStreamingCall-1.html">AsyncServerStreamingCall</a>&lt;TResponse&gt;</td>
  297. <td><p>A call object providing access to the asynchronous response stream.</p>
  298. </td>
  299. </tr>
  300. </tbody>
  301. </table>
  302. <h5 class="typeParameters">Type Parameters</h5>
  303. <table class="table table-bordered table-striped table-condensed">
  304. <thead>
  305. <tr>
  306. <th>Name</th>
  307. <th>Description</th>
  308. </tr>
  309. </thead>
  310. <tbody>
  311. <tr>
  312. <td><span class="parametername">TRequest</span></td>
  313. <td><p>Type of request message.</p>
  314. </td>
  315. </tr>
  316. <tr>
  317. <td><span class="parametername">TResponse</span></td>
  318. <td><p>The of response messages.</p>
  319. </td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. <a id="Grpc_Core_Calls_AsyncUnaryCall_" data-uid="Grpc.Core.Calls.AsyncUnaryCall*"></a>
  324. <h4 id="Grpc_Core_Calls_AsyncUnaryCall__2_Grpc_Core_CallInvocationDetails___0___1____0_" data-uid="Grpc.Core.Calls.AsyncUnaryCall``2(Grpc.Core.CallInvocationDetails{``0,``1},``0)">AsyncUnaryCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt;, TRequest)</h4>
  325. <div class="markdown level1 summary"><p>Invokes a simple remote call asynchronously.</p>
  326. </div>
  327. <div class="markdown level1 conceptual"></div>
  328. <h5 class="decalaration">Declaration</h5>
  329. <div class="codewrapper">
  330. <pre><code class="lang-csharp hljs">public static AsyncUnaryCall&lt;TResponse&gt; AsyncUnaryCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt; call, TRequest req)
  331. where TRequest : class where TResponse : class</code></pre>
  332. </div>
  333. <h5 class="parameters">Parameters</h5>
  334. <table class="table table-bordered table-striped table-condensed">
  335. <thead>
  336. <tr>
  337. <th>Type</th>
  338. <th>Name</th>
  339. <th>Description</th>
  340. </tr>
  341. </thead>
  342. <tbody>
  343. <tr>
  344. <td><a class="xref" href="Grpc.Core.CallInvocationDetails-2.html">CallInvocationDetails</a>&lt;TRequest, TResponse&gt;</td>
  345. <td><span class="parametername">call</span></td>
  346. <td><p>The call definition.</p>
  347. </td>
  348. </tr>
  349. <tr>
  350. <td><span class="xref">TRequest</span></td>
  351. <td><span class="parametername">req</span></td>
  352. <td><p>Request message.</p>
  353. </td>
  354. </tr>
  355. </tbody>
  356. </table>
  357. <h5 class="returns">Returns</h5>
  358. <table class="table table-bordered table-striped table-condensed">
  359. <thead>
  360. <tr>
  361. <th>Type</th>
  362. <th>Description</th>
  363. </tr>
  364. </thead>
  365. <tbody>
  366. <tr>
  367. <td><a class="xref" href="Grpc.Core.AsyncUnaryCall-1.html">AsyncUnaryCall</a>&lt;TResponse&gt;</td>
  368. <td><p>An awaitable call object providing access to the response.</p>
  369. </td>
  370. </tr>
  371. </tbody>
  372. </table>
  373. <h5 class="typeParameters">Type Parameters</h5>
  374. <table class="table table-bordered table-striped table-condensed">
  375. <thead>
  376. <tr>
  377. <th>Name</th>
  378. <th>Description</th>
  379. </tr>
  380. </thead>
  381. <tbody>
  382. <tr>
  383. <td><span class="parametername">TRequest</span></td>
  384. <td><p>Type of request message.</p>
  385. </td>
  386. </tr>
  387. <tr>
  388. <td><span class="parametername">TResponse</span></td>
  389. <td><p>The of response message.</p>
  390. </td>
  391. </tr>
  392. </tbody>
  393. </table>
  394. <a id="Grpc_Core_Calls_BlockingUnaryCall_" data-uid="Grpc.Core.Calls.BlockingUnaryCall*"></a>
  395. <h4 id="Grpc_Core_Calls_BlockingUnaryCall__2_Grpc_Core_CallInvocationDetails___0___1____0_" data-uid="Grpc.Core.Calls.BlockingUnaryCall``2(Grpc.Core.CallInvocationDetails{``0,``1},``0)">BlockingUnaryCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt;, TRequest)</h4>
  396. <div class="markdown level1 summary"><p>Invokes a simple remote call in a blocking fashion.</p>
  397. </div>
  398. <div class="markdown level1 conceptual"></div>
  399. <h5 class="decalaration">Declaration</h5>
  400. <div class="codewrapper">
  401. <pre><code class="lang-csharp hljs">public static TResponse BlockingUnaryCall&lt;TRequest, TResponse&gt;(CallInvocationDetails&lt;TRequest, TResponse&gt; call, TRequest req)
  402. where TRequest : class where TResponse : class</code></pre>
  403. </div>
  404. <h5 class="parameters">Parameters</h5>
  405. <table class="table table-bordered table-striped table-condensed">
  406. <thead>
  407. <tr>
  408. <th>Type</th>
  409. <th>Name</th>
  410. <th>Description</th>
  411. </tr>
  412. </thead>
  413. <tbody>
  414. <tr>
  415. <td><a class="xref" href="Grpc.Core.CallInvocationDetails-2.html">CallInvocationDetails</a>&lt;TRequest, TResponse&gt;</td>
  416. <td><span class="parametername">call</span></td>
  417. <td><p>The call definition.</p>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td><span class="xref">TRequest</span></td>
  422. <td><span class="parametername">req</span></td>
  423. <td><p>Request message.</p>
  424. </td>
  425. </tr>
  426. </tbody>
  427. </table>
  428. <h5 class="returns">Returns</h5>
  429. <table class="table table-bordered table-striped table-condensed">
  430. <thead>
  431. <tr>
  432. <th>Type</th>
  433. <th>Description</th>
  434. </tr>
  435. </thead>
  436. <tbody>
  437. <tr>
  438. <td><span class="xref">TResponse</span></td>
  439. <td><p>The response.</p>
  440. </td>
  441. </tr>
  442. </tbody>
  443. </table>
  444. <h5 class="typeParameters">Type Parameters</h5>
  445. <table class="table table-bordered table-striped table-condensed">
  446. <thead>
  447. <tr>
  448. <th>Name</th>
  449. <th>Description</th>
  450. </tr>
  451. </thead>
  452. <tbody>
  453. <tr>
  454. <td><span class="parametername">TRequest</span></td>
  455. <td><p>Type of request message.</p>
  456. </td>
  457. </tr>
  458. <tr>
  459. <td><span class="parametername">TResponse</span></td>
  460. <td><p>The of response message.</p>
  461. </td>
  462. </tr>
  463. </tbody>
  464. </table>
  465. </article>
  466. </div>
  467. <div class="hidden-sm col-md-2" role="complementary">
  468. <div class="sideaffix">
  469. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  470. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  471. </nav>
  472. </div>
  473. </div>
  474. </div>
  475. </div>
  476. <footer>
  477. <div class="grad-bottom"></div>
  478. <div class="footer">
  479. <div class="container">
  480. <span class="pull-right">
  481. <a href="#top">Back to top</a>
  482. </span>
  483. <span>Generated by <strong>DocFX</strong></span>
  484. </div>
  485. </div>
  486. </footer>
  487. </div>
  488. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  489. <script type="text/javascript" src="../styles/docfx.js"></script>
  490. <script type="text/javascript" src="../styles/main.js"></script>
  491. </body>
  492. </html>