grpc-ClientDuplexStream.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: ClientDuplexStream</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: ClientDuplexStream</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>
  20. <span class="ancestors"><a href="grpc.html">grpc</a>~</span>ClientDuplexStream<span class="signature">(call, serialize<span class="signature-attributes">opt</span>, deserialize<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h4 class="name" id="ClientDuplexStream"><span class="type-signature"></span>new ClientDuplexStream<span class="signature">(call, serialize<span class="signature-attributes">opt</span>, deserialize<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
  25. <div class="description">
  26. <p>A stream that the client can read from or write to. Used for calls with
  27. duplex streaming.</p>
  28. </div>
  29. <h5>Parameters:</h5>
  30. <table class="params">
  31. <thead>
  32. <tr>
  33. <th>Name</th>
  34. <th>Type</th>
  35. <th>Attributes</th>
  36. <th>Default</th>
  37. <th class="last">Description</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>call</code></td>
  43. <td class="type">
  44. <span class="param-type">grpc.internal~Call</span>
  45. </td>
  46. <td class="attributes">
  47. </td>
  48. <td class="default">
  49. </td>
  50. <td class="description last"><p>Call object to proxy</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>serialize</code></td>
  54. <td class="type">
  55. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  56. </td>
  57. <td class="attributes">
  58. &lt;optional><br>
  59. </td>
  60. <td class="default">
  61. identity
  62. </td>
  63. <td class="description last"><p>Serialization
  64. function for requests</p></td>
  65. </tr>
  66. <tr>
  67. <td class="name"><code>deserialize</code></td>
  68. <td class="type">
  69. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  70. </td>
  71. <td class="attributes">
  72. &lt;optional><br>
  73. </td>
  74. <td class="default">
  75. identity
  76. </td>
  77. <td class="description last"><p>Deserialization function for responses</p></td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. <dl class="details">
  82. <dt class="tag-source">Source:</dt>
  83. <dd class="tag-source"><ul class="dummy"><li>
  84. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line323">line 323</a>
  85. </li></ul></dd>
  86. </dl>
  87. </div>
  88. <h3 class="subsection-title">Extends</h3>
  89. <ul>
  90. <li><a href="external-Duplex.html">external:Duplex</a></li>
  91. </ul>
  92. <h3 class="subsection-title">Methods</h3>
  93. <h4 class="name" id="cancel"><span class="type-signature"></span>cancel<span class="signature">()</span><span class="type-signature"></span></h4>
  94. <div class="description">
  95. <p>Cancel the ongoing call. Results in the call ending with a CANCELLED status,
  96. unless it has already ended with some other status.</p>
  97. </div>
  98. <dl class="details">
  99. <dt class="tag-source">Source:</dt>
  100. <dd class="tag-source"><ul class="dummy"><li>
  101. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line369">line 369</a>
  102. </li></ul></dd>
  103. </dl>
  104. <h4 class="name" id="getPeer"><span class="type-signature"></span>getPeer<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
  105. <div class="description">
  106. <p>Get the endpoint this call/stream is connected to.</p>
  107. </div>
  108. <dl class="details">
  109. <dt class="tag-source">Source:</dt>
  110. <dd class="tag-source"><ul class="dummy"><li>
  111. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line384">line 384</a>
  112. </li></ul></dd>
  113. </dl>
  114. <h5>Returns:</h5>
  115. <div class="param-desc">
  116. <p>The URI of the endpoint</p>
  117. </div>
  118. <dl>
  119. <dt>
  120. Type
  121. </dt>
  122. <dd>
  123. <span class="param-type">string</span>
  124. </dd>
  125. </dl>
  126. <h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">(message, flags, callback)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  127. <div class="description">
  128. <p>Write a message to the request stream. If serializing the argument fails,
  129. the call will be cancelled and the stream will end with an error.</p>
  130. </div>
  131. <h5>Parameters:</h5>
  132. <table class="params">
  133. <thead>
  134. <tr>
  135. <th>Name</th>
  136. <th>Type</th>
  137. <th class="last">Description</th>
  138. </tr>
  139. </thead>
  140. <tbody>
  141. <tr>
  142. <td class="name"><code>message</code></td>
  143. <td class="type">
  144. <span class="param-type">*</span>
  145. </td>
  146. <td class="description last"><p>The message to write. Must be a valid argument to the
  147. serialize function of the corresponding method</p></td>
  148. </tr>
  149. <tr>
  150. <td class="name"><code>flags</code></td>
  151. <td class="type">
  152. <span class="param-type"><a href="grpc.html#.writeFlags">grpc.writeFlags</a></span>
  153. </td>
  154. <td class="description last"><p>Flags to modify how the message is written</p></td>
  155. </tr>
  156. <tr>
  157. <td class="name"><code>callback</code></td>
  158. <td class="type">
  159. <span class="param-type">function</span>
  160. </td>
  161. <td class="description last"><p>Callback for when this chunk of data is flushed</p></td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. <dl class="details">
  166. <dt class="tag-source">Source:</dt>
  167. <dd class="tag-source"><ul class="dummy"><li>
  168. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line110">line 110</a>
  169. </li></ul></dd>
  170. </dl>
  171. <h5>Returns:</h5>
  172. <div class="param-desc">
  173. <p>As defined for <a href="external-Writable.html">Writable</a></p>
  174. </div>
  175. <dl>
  176. <dt>
  177. Type
  178. </dt>
  179. <dd>
  180. <span class="param-type">boolean</span>
  181. </dd>
  182. </dl>
  183. <h3 class="subsection-title">Events</h3>
  184. <h4 class="name" id="event:metadata">metadata</h4>
  185. <div class="description">
  186. <p>Initial response metadata sent by the server when it starts processing the
  187. call</p>
  188. </div>
  189. <h5>Type:</h5>
  190. <ul>
  191. <li>
  192. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  193. </li>
  194. </ul>
  195. <dl class="details">
  196. <dt class="tag-source">Source:</dt>
  197. <dd class="tag-source"><ul class="dummy"><li>
  198. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line56">line 56</a>
  199. </li></ul></dd>
  200. </dl>
  201. <h4 class="name" id="event:status">status</h4>
  202. <div class="description">
  203. <p>Status of the call when it has completed.</p>
  204. </div>
  205. <h5>Type:</h5>
  206. <ul>
  207. <li>
  208. <span class="param-type"><a href="grpc.html#~StatusObject">grpc~StatusObject</a></span>
  209. </li>
  210. </ul>
  211. <dl class="details">
  212. <dt class="tag-source">Source:</dt>
  213. <dd class="tag-source"><ul class="dummy"><li>
  214. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line63">line 63</a>
  215. </li></ul></dd>
  216. </dl>
  217. </article>
  218. </section>
  219. </div>
  220. <nav>
  221. <h2><a href="index.html">Home</a></h2><h3>Externals</h3><ul><li><a href="external-Duplex.html">Duplex</a></li><li><a href="external-EventEmitter.html">EventEmitter</a></li><li><a href="external-GoogleCredential.html">GoogleCredential</a></li><li><a href="external-Readable.html">Readable</a></li><li><a href="external-Writable.html">Writable</a></li></ul><h3>Classes</h3><ul><li><a href="grpc.Client.html">Client</a></li><li><a href="grpc.credentials-CallCredentials.html">CallCredentials</a></li><li><a href="grpc.credentials-ChannelCredentials.html">ChannelCredentials</a></li><li><a href="grpc.Metadata.html">Metadata</a></li><li><a href="grpc.Server.html">Server</a></li><li><a href="grpc.ServerCredentials.html">ServerCredentials</a></li><li><a href="grpc-ClientDuplexStream.html">ClientDuplexStream</a></li><li><a href="grpc-ClientReadableStream.html">ClientReadableStream</a></li><li><a href="grpc-ClientUnaryCall.html">ClientUnaryCall</a></li><li><a href="grpc-ClientWritableStream.html">ClientWritableStream</a></li><li><a href="grpc-ServerDuplexStream.html">ServerDuplexStream</a></li><li><a href="grpc-ServerReadableStream.html">ServerReadableStream</a></li><li><a href="grpc-ServerUnaryCall.html">ServerUnaryCall</a></li><li><a href="grpc-ServerWritableStream.html">ServerWritableStream</a></li></ul><h3>Events</h3><ul><li><a href="grpc-ClientDuplexStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientDuplexStream.html#event:status">status</a></li><li><a href="grpc-ClientReadableStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientReadableStream.html#event:status">status</a></li><li><a href="grpc-ClientUnaryCall.html#event:metadata">metadata</a></li><li><a href="grpc-ClientUnaryCall.html#event:status">status</a></li><li><a href="grpc-ClientWritableStream.html#event:metadata">metadata</a></li><li><a href="grpc-ClientWritableStream.html#event:status">status</a></li><li><a href="grpc-ServerDuplexStream.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerReadableStream.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerUnaryCall.html#~event:cancelled">cancelled</a></li><li><a href="grpc-ServerWritableStream.html#~event:cancelled">cancelled</a></li></ul><h3>Namespaces</h3><ul><li><a href="grpc.html">grpc</a></li><li><a href="grpc.credentials.html">credentials</a></li></ul>
  222. </nav>
  223. <br class="clear">
  224. <footer>
  225. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Fri Sep 08 2017 11:10:31 GMT-0700 (PDT)
  226. </footer>
  227. <script> prettyPrint(); </script>
  228. <script src="scripts/linenumber.js"> </script>
  229. </body>
  230. </html>