grpc-ClientWritableStream.html 16 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  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: ClientWritableStream</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. <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-60127042-1', 'auto'); ga('send', 'pageview'); </script></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: ClientWritableStream</h1>
  69. <section>
  70. <header>
  71. <h2>
  72. <span class="ancestors"><a href="grpc.html">grpc</a>~</span>
  73. ClientWritableStream
  74. </h2>
  75. </header>
  76. <article>
  77. <div class="container-overview">
  78. <hr>
  79. <dt>
  80. <h4 class="name" id="ClientWritableStream"><span class="type-signature"></span>new ClientWritableStream(call [, serialize])</h4>
  81. </dt>
  82. <dd>
  83. <div class="description">
  84. <p>A stream that the client can write to. Used for calls that are streaming from
  85. the client side.</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>The call object to send data with</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 writes.</p></td>
  123. </tr>
  124. </tbody>
  125. </table>
  126. <dl class="details">
  127. </dl>
  128. </dd>
  129. </div>
  130. <h3 class="subsection-title">Extends</h3>
  131. <ul>
  132. <li><a href="external-Writable.html">external:Writable</a></li>
  133. </ul>
  134. <h3 class="subsection-title">Methods</h3>
  135. <dl>
  136. <hr>
  137. <dt>
  138. <h4 class="name" id="cancel"><span class="type-signature"></span>cancel()</h4>
  139. </dt>
  140. <dd>
  141. <div class="description">
  142. <p>Cancel the ongoing call. Results in the call ending with a CANCELLED status,
  143. unless it has already ended with some other status.</p>
  144. </div>
  145. <dl class="details">
  146. </dl>
  147. </dd>
  148. <hr>
  149. <dt>
  150. <h4 class="name" id="getPeer"><span class="type-signature"></span>getPeer()</h4>
  151. </dt>
  152. <dd>
  153. <div class="description">
  154. <p>Get the endpoint this call/stream is connected to.</p>
  155. </div>
  156. <dl class="details">
  157. </dl>
  158. <h5>Returns:</h5>
  159. <div class="param-desc">
  160. <p>The URI of the endpoint</p>
  161. </div>
  162. <dl>
  163. <dt>
  164. Type
  165. </dt>
  166. <dd>
  167. <span class="param-type">string</span>
  168. </dd>
  169. </dl>
  170. </dd>
  171. <hr>
  172. <dt>
  173. <h4 class="name" id="write"><span class="type-signature"></span>write(message, flags, callback)</h4>
  174. </dt>
  175. <dd>
  176. <div class="description">
  177. <p>Write a message to the request stream. If serializing the argument fails,
  178. the call will be cancelled and the stream will end with an error.</p>
  179. </div>
  180. <h5>Parameters:</h5>
  181. <table class="params table table-striped">
  182. <thead>
  183. <tr>
  184. <th>Name</th>
  185. <th>Type</th>
  186. <th class="last">Description</th>
  187. </tr>
  188. </thead>
  189. <tbody>
  190. <tr>
  191. <td class="name"><code>message</code></td>
  192. <td class="type">
  193. <span class="param-type">*</span>
  194. </td>
  195. <td class="description last"><p>The message to write. Must be a valid argument to the
  196. serialize function of the corresponding method</p></td>
  197. </tr>
  198. <tr>
  199. <td class="name"><code>flags</code></td>
  200. <td class="type">
  201. <span class="param-type"><a href="grpc.html#.writeFlags">grpc.writeFlags</a></span>
  202. </td>
  203. <td class="description last"><p>Flags to modify how the message is written</p></td>
  204. </tr>
  205. <tr>
  206. <td class="name"><code>callback</code></td>
  207. <td class="type">
  208. <span class="param-type">function</span>
  209. </td>
  210. <td class="description last"><p>Callback for when this chunk of data is flushed</p></td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <dl class="details">
  215. </dl>
  216. <h5>Returns:</h5>
  217. <div class="param-desc">
  218. <p>As defined for <a href="external-Writable.html">Writable</a></p>
  219. </div>
  220. <dl>
  221. <dt>
  222. Type
  223. </dt>
  224. <dd>
  225. <span class="param-type">boolean</span>
  226. </dd>
  227. </dl>
  228. </dd>
  229. </dl>
  230. <h3 class="subsection-title">Events</h3>
  231. <dl>
  232. <hr>
  233. <dt>
  234. <h4 class="name" id="event:metadata">metadata</h4>
  235. </dt>
  236. <dd>
  237. <div class="description">
  238. <p>Initial response metadata sent by the server when it starts processing the
  239. call</p>
  240. </div>
  241. <h5>Type:
  242. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  243. </h5>
  244. <dl class="details">
  245. </dl>
  246. </dd>
  247. <hr>
  248. <dt>
  249. <h4 class="name" id="event:status">status</h4>
  250. </dt>
  251. <dd>
  252. <div class="description">
  253. <p>Status of the call when it has completed.</p>
  254. </div>
  255. <h5>Type:
  256. <span class="param-type"><a href="grpc.html#~StatusObject">grpc~StatusObject</a></span>
  257. </h5>
  258. <dl class="details">
  259. </dl>
  260. </dd>
  261. </dl>
  262. </article>
  263. </section>
  264. </div>
  265. </div>
  266. <div class="clearfix"></div>
  267. <div class="col-md-3">
  268. <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="modal fade" id="searchResults">
  273. <div class="modal-dialog">
  274. <div class="modal-content">
  275. <div class="modal-header">
  276. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  277. <h4 class="modal-title">Search results</h4>
  278. </div>
  279. <div class="modal-body"></div>
  280. <div class="modal-footer">
  281. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  282. </div>
  283. </div><!-- /.modal-content -->
  284. </div><!-- /.modal-dialog -->
  285. </div>
  286. <footer>
  287. <span class="jsdoc-message">
  288. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
  289. on 2018-01-16T12:05:13-05:00
  290. using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
  291. </span>
  292. </footer>
  293. <script src="scripts/docstrap.lib.js"></script>
  294. <script src="scripts/toc.js"></script>
  295. <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
  296. <script>
  297. $( function () {
  298. $( "[id*='$']" ).each( function () {
  299. var $this = $( this );
  300. $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
  301. } );
  302. $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
  303. var $this = $( this );
  304. var example = $this.find( "code" );
  305. exampleText = example.html();
  306. var lang = /{@lang (.*?)}/.exec( exampleText );
  307. if ( lang && lang[1] ) {
  308. exampleText = exampleText.replace( lang[0], "" );
  309. example.html( exampleText );
  310. lang = lang[1];
  311. } else {
  312. var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
  313. lang = langClassMatch ? langClassMatch[1] : "javascript";
  314. }
  315. if ( lang ) {
  316. $this
  317. .addClass( "sunlight-highlight-" + lang )
  318. .addClass( "linenums" )
  319. .html( example.html() );
  320. }
  321. } );
  322. Sunlight.highlightAll( {
  323. lineNumbers : false,
  324. showMenu : true,
  325. enableDoclinks : true
  326. } );
  327. $.catchAnchorLinks( {
  328. navbarOffset: 10
  329. } );
  330. $( "#toc" ).toc( {
  331. anchorName : function ( i, heading, prefix ) {
  332. return $( heading ).attr( "id" ) || ( prefix + i );
  333. },
  334. selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
  335. showAndHide : false,
  336. smoothScrolling: true
  337. } );
  338. $( "#main span[id^='toc']" ).addClass( "toc-shim" );
  339. $( '.dropdown-toggle' ).dropdown();
  340. $( "table" ).each( function () {
  341. var $this = $( this );
  342. $this.addClass('table');
  343. } );
  344. } );
  345. </script>
  346. <!--Navigation and Symbol Display-->
  347. <!--Google Analytics-->
  348. <script type="text/javascript">
  349. $(document).ready(function() {
  350. SearcherDisplay.init();
  351. });
  352. </script>
  353. </body>
  354. </html>