grpc-ClientDuplexStream.html 16 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Documentation Class: ClientDuplexStream</title>
  7. <!--[if lt IE 9]>
  8. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  9. <![endif]-->
  10. <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
  11. <link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
  12. </head>
  13. <body>
  14. <div class="navbar navbar-default navbar-fixed-top ">
  15. <div class="container">
  16. <div class="navbar-header">
  17. <a class="navbar-brand" href="index.html">Documentation</a>
  18. <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
  19. <span class="icon-bar"></span>
  20. <span class="icon-bar"></span>
  21. <span class="icon-bar"></span>
  22. </button>
  23. </div>
  24. <div class="navbar-collapse collapse" id="topNavigation">
  25. <ul class="nav navbar-nav">
  26. <li class="dropdown">
  27. <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
  28. <ul class="dropdown-menu ">
  29. <li><a href="grpc.html">grpc</a></li><li><a href="grpc.credentials.html">grpc.credentials</a></li>
  30. </ul>
  31. </li>
  32. <li class="dropdown">
  33. <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
  34. <ul class="dropdown-menu ">
  35. <li><a href="grpc.Client.html">grpc.Client</a></li><li><a href="grpc.credentials-CallCredentials.html">grpc.credentials~CallCredentials</a></li><li><a href="grpc.credentials-ChannelCredentials.html">grpc.credentials~ChannelCredentials</a></li><li><a href="grpc.Metadata.html">grpc.Metadata</a></li><li><a href="grpc.Server.html">grpc.Server</a></li><li><a href="grpc.ServerCredentials.html">grpc.ServerCredentials</a></li><li><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></li><li><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></li><li><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></li><li><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></li><li><a href="grpc-ServerDuplexStream.html">grpc~ServerDuplexStream</a></li><li><a href="grpc-ServerReadableStream.html">grpc~ServerReadableStream</a></li><li><a href="grpc-ServerUnaryCall.html">grpc~ServerUnaryCall</a></li><li><a href="grpc-ServerWritableStream.html">grpc~ServerWritableStream</a></li>
  36. </ul>
  37. </li>
  38. <li class="dropdown">
  39. <a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
  40. <ul class="dropdown-menu ">
  41. <li><a href="grpc-ClientDuplexStream.html#event:metadata">grpc~ClientDuplexStream#metadata</a></li><li><a href="grpc-ClientDuplexStream.html#event:status">grpc~ClientDuplexStream#status</a></li><li><a href="grpc-ClientReadableStream.html#event:metadata">grpc~ClientReadableStream#metadata</a></li><li><a href="grpc-ClientReadableStream.html#event:status">grpc~ClientReadableStream#status</a></li><li><a href="grpc-ClientUnaryCall.html#event:metadata">grpc~ClientUnaryCall#event:metadata</a></li><li><a href="grpc-ClientUnaryCall.html#event:status">grpc~ClientUnaryCall#event:status</a></li><li><a href="grpc-ClientWritableStream.html#event:metadata">grpc~ClientWritableStream#metadata</a></li><li><a href="grpc-ClientWritableStream.html#event:status">grpc~ClientWritableStream#status</a></li><li><a href="grpc-ServerDuplexStream.html#~event:cancelled">grpc~ServerDuplexStream~event:cancelled</a></li><li><a href="grpc-ServerReadableStream.html#~event:cancelled">grpc~ServerReadableStream~event:cancelled</a></li><li><a href="grpc-ServerUnaryCall.html#~event:cancelled">grpc~ServerUnaryCall~event:cancelled</a></li><li><a href="grpc-ServerWritableStream.html#~event:cancelled">grpc~ServerWritableStream~event:cancelled</a></li>
  42. </ul>
  43. </li>
  44. <li class="dropdown">
  45. <a href="externals.list.html" class="dropdown-toggle" data-toggle="dropdown">Externals<b class="caret"></b></a>
  46. <ul class="dropdown-menu ">
  47. <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>
  48. </ul>
  49. </li>
  50. </ul>
  51. <div class="col-sm-3 col-md-3">
  52. <form class="navbar-form" role="search">
  53. <div class="input-group">
  54. <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
  55. <div class="input-group-btn">
  56. <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
  57. </div>
  58. </div>
  59. </form>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="container" id="toc-content">
  65. <div class="row">
  66. <div class="col-md-8">
  67. <div id="main">
  68. <h1 class="page-title">Class: ClientDuplexStream</h1>
  69. <section>
  70. <header>
  71. <h2>
  72. <span class="ancestors"><a href="grpc.html">grpc</a>~</span>
  73. ClientDuplexStream
  74. </h2>
  75. </header>
  76. <article>
  77. <div class="container-overview">
  78. <hr>
  79. <dt>
  80. <h4 class="name" id="ClientDuplexStream"><span class="type-signature"></span>new ClientDuplexStream(call [, serialize] [, deserialize])</h4>
  81. </dt>
  82. <dd>
  83. <div class="description">
  84. <p>A stream that the client can read from or write to. Used for calls with
  85. duplex streaming.</p>
  86. </div>
  87. <h5>Parameters:</h5>
  88. <table class="params table table-striped">
  89. <thead>
  90. <tr>
  91. <th>Name</th>
  92. <th>Type</th>
  93. <th>Argument</th>
  94. <th>Default</th>
  95. <th class="last">Description</th>
  96. </tr>
  97. </thead>
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>call</code></td>
  101. <td class="type">
  102. <span class="param-type">grpc.internal~Call</span>
  103. </td>
  104. <td class="attributes">
  105. </td>
  106. <td class="default">
  107. </td>
  108. <td class="description last"><p>Call object to proxy</p></td>
  109. </tr>
  110. <tr>
  111. <td class="name"><code>serialize</code></td>
  112. <td class="type">
  113. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  114. </td>
  115. <td class="attributes">
  116. &lt;optional><br>
  117. </td>
  118. <td class="default">
  119. identity
  120. </td>
  121. <td class="description last"><p>Serialization
  122. function for requests</p></td>
  123. </tr>
  124. <tr>
  125. <td class="name"><code>deserialize</code></td>
  126. <td class="type">
  127. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  128. </td>
  129. <td class="attributes">
  130. &lt;optional><br>
  131. </td>
  132. <td class="default">
  133. identity
  134. </td>
  135. <td class="description last"><p>Deserialization function for responses</p></td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <dl class="details">
  140. </dl>
  141. </dd>
  142. </div>
  143. <h3 class="subsection-title">Extends</h3>
  144. <ul>
  145. <li><a href="external-Duplex.html">external:Duplex</a></li>
  146. </ul>
  147. <h3 class="subsection-title">Methods</h3>
  148. <dl>
  149. <hr>
  150. <dt>
  151. <h4 class="name" id="cancel"><span class="type-signature"></span>cancel()</h4>
  152. </dt>
  153. <dd>
  154. <div class="description">
  155. <p>Cancel the ongoing call. Results in the call ending with a CANCELLED status,
  156. unless it has already ended with some other status.</p>
  157. </div>
  158. <dl class="details">
  159. </dl>
  160. </dd>
  161. <hr>
  162. <dt>
  163. <h4 class="name" id="getPeer"><span class="type-signature"></span>getPeer()</h4>
  164. </dt>
  165. <dd>
  166. <div class="description">
  167. <p>Get the endpoint this call/stream is connected to.</p>
  168. </div>
  169. <dl class="details">
  170. </dl>
  171. <h5>Returns:</h5>
  172. <div class="param-desc">
  173. <p>The URI of the endpoint</p>
  174. </div>
  175. <dl>
  176. <dt>
  177. Type
  178. </dt>
  179. <dd>
  180. <span class="param-type">string</span>
  181. </dd>
  182. </dl>
  183. </dd>
  184. <hr>
  185. <dt>
  186. <h4 class="name" id="write"><span class="type-signature"></span>write(message, flags, callback)</h4>
  187. </dt>
  188. <dd>
  189. <div class="description">
  190. <p>Write a message to the request stream. If serializing the argument fails,
  191. the call will be cancelled and the stream will end with an error.</p>
  192. </div>
  193. <h5>Parameters:</h5>
  194. <table class="params table table-striped">
  195. <thead>
  196. <tr>
  197. <th>Name</th>
  198. <th>Type</th>
  199. <th class="last">Description</th>
  200. </tr>
  201. </thead>
  202. <tbody>
  203. <tr>
  204. <td class="name"><code>message</code></td>
  205. <td class="type">
  206. <span class="param-type">*</span>
  207. </td>
  208. <td class="description last"><p>The message to write. Must be a valid argument to the
  209. serialize function of the corresponding method</p></td>
  210. </tr>
  211. <tr>
  212. <td class="name"><code>flags</code></td>
  213. <td class="type">
  214. <span class="param-type"><a href="grpc.html#.writeFlags">grpc.writeFlags</a></span>
  215. </td>
  216. <td class="description last"><p>Flags to modify how the message is written</p></td>
  217. </tr>
  218. <tr>
  219. <td class="name"><code>callback</code></td>
  220. <td class="type">
  221. <span class="param-type">function</span>
  222. </td>
  223. <td class="description last"><p>Callback for when this chunk of data is flushed</p></td>
  224. </tr>
  225. </tbody>
  226. </table>
  227. <dl class="details">
  228. </dl>
  229. <h5>Returns:</h5>
  230. <div class="param-desc">
  231. <p>As defined for <a href="external-Writable.html">Writable</a></p>
  232. </div>
  233. <dl>
  234. <dt>
  235. Type
  236. </dt>
  237. <dd>
  238. <span class="param-type">boolean</span>
  239. </dd>
  240. </dl>
  241. </dd>
  242. </dl>
  243. <h3 class="subsection-title">Events</h3>
  244. <dl>
  245. <hr>
  246. <dt>
  247. <h4 class="name" id="event:metadata">metadata</h4>
  248. </dt>
  249. <dd>
  250. <div class="description">
  251. <p>Initial response metadata sent by the server when it starts processing the
  252. call</p>
  253. </div>
  254. <h5>Type:
  255. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  256. </h5>
  257. <dl class="details">
  258. </dl>
  259. </dd>
  260. <hr>
  261. <dt>
  262. <h4 class="name" id="event:status">status</h4>
  263. </dt>
  264. <dd>
  265. <div class="description">
  266. <p>Status of the call when it has completed.</p>
  267. </div>
  268. <h5>Type:
  269. <span class="param-type"><a href="grpc.html#~StatusObject">grpc~StatusObject</a></span>
  270. </h5>
  271. <dl class="details">
  272. </dl>
  273. </dd>
  274. </dl>
  275. </article>
  276. </section>
  277. </div>
  278. </div>
  279. <div class="clearfix"></div>
  280. <div class="col-md-3">
  281. <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
  282. </div>
  283. </div>
  284. </div>
  285. <div class="modal fade" id="searchResults">
  286. <div class="modal-dialog">
  287. <div class="modal-content">
  288. <div class="modal-header">
  289. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  290. <h4 class="modal-title">Search results</h4>
  291. </div>
  292. <div class="modal-body"></div>
  293. <div class="modal-footer">
  294. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  295. </div>
  296. </div><!-- /.modal-content -->
  297. </div><!-- /.modal-dialog -->
  298. </div>
  299. <footer>
  300. <span class="jsdoc-message">
  301. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
  302. on 2018-01-16T12:05:13-05:00
  303. using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
  304. </span>
  305. </footer>
  306. <script src="scripts/docstrap.lib.js"></script>
  307. <script src="scripts/toc.js"></script>
  308. <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
  309. <script>
  310. $( function () {
  311. $( "[id*='$']" ).each( function () {
  312. var $this = $( this );
  313. $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
  314. } );
  315. $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
  316. var $this = $( this );
  317. var example = $this.find( "code" );
  318. exampleText = example.html();
  319. var lang = /{@lang (.*?)}/.exec( exampleText );
  320. if ( lang && lang[1] ) {
  321. exampleText = exampleText.replace( lang[0], "" );
  322. example.html( exampleText );
  323. lang = lang[1];
  324. } else {
  325. var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
  326. lang = langClassMatch ? langClassMatch[1] : "javascript";
  327. }
  328. if ( lang ) {
  329. $this
  330. .addClass( "sunlight-highlight-" + lang )
  331. .addClass( "linenums" )
  332. .html( example.html() );
  333. }
  334. } );
  335. Sunlight.highlightAll( {
  336. lineNumbers : false,
  337. showMenu : true,
  338. enableDoclinks : true
  339. } );
  340. $.catchAnchorLinks( {
  341. navbarOffset: 10
  342. } );
  343. $( "#toc" ).toc( {
  344. anchorName : function ( i, heading, prefix ) {
  345. return $( heading ).attr( "id" ) || ( prefix + i );
  346. },
  347. selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
  348. showAndHide : false,
  349. smoothScrolling: true
  350. } );
  351. $( "#main span[id^='toc']" ).addClass( "toc-shim" );
  352. $( '.dropdown-toggle' ).dropdown();
  353. $( "table" ).each( function () {
  354. var $this = $( this );
  355. $this.addClass('table');
  356. } );
  357. } );
  358. </script>
  359. <!--Navigation and Symbol Display-->
  360. <!--Google Analytics-->
  361. <script type="text/javascript">
  362. $(document).ready(function() {
  363. SearcherDisplay.init();
  364. });
  365. </script>
  366. </body>
  367. </html>