grpc-ClientWritableStream.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  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. </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="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
  34. <ul class="dropdown-menu ">
  35. <li><a href="module-src_client_interceptors.html">src/client_interceptors</a></li>
  36. </ul>
  37. </li>
  38. <li class="dropdown">
  39. <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
  40. <ul class="dropdown-menu ">
  41. <li><a href="grpc.Channel.html">grpc.Channel</a></li><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-Call.html">grpc~Call</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><li><a href="module-src_client_interceptors-EndListener.html">src/client_interceptors~EndListener</a></li><li><a href="module-src_client_interceptors-InterceptingCall.html">src/client_interceptors~InterceptingCall</a></li><li><a href="module-src_client_interceptors-InterceptingListener.html">src/client_interceptors~InterceptingListener</a></li><li><a href="module-src_client_interceptors-InterceptorConfigurationError.html">src/client_interceptors~InterceptorConfigurationError</a></li><li><a href="module-src_client_interceptors-ListenerBuilder.html">src/client_interceptors~ListenerBuilder</a></li><li><a href="module-src_client_interceptors-RequesterBuilder.html">src/client_interceptors~RequesterBuilder</a></li><li><a href="module-src_client_interceptors-StatusBuilder.html">src/client_interceptors~StatusBuilder</a></li>
  42. </ul>
  43. </li>
  44. <li class="dropdown">
  45. <a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
  46. <ul class="dropdown-menu ">
  47. <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>
  48. </ul>
  49. </li>
  50. <li class="dropdown">
  51. <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
  52. <ul class="dropdown-menu ">
  53. <li><a href="global.html#CancelRequester">CancelRequester</a></li><li><a href="global.html#CloseRequester">CloseRequester</a></li><li><a href="global.html#createStatusError">createStatusError</a></li><li><a href="global.html#getClientInterceptors">getClientInterceptors</a></li><li><a href="global.html#getMethodType">getMethodType</a></li><li><a href="global.html#GetPeerRequester">GetPeerRequester</a></li><li><a href="global.html#Interceptor">Interceptor</a></li><li><a href="global.html#InterceptorProvider">InterceptorProvider</a></li><li><a href="global.html#loadPackageDefinition">loadPackageDefinition</a></li><li><a href="global.html#MessageListener">MessageListener</a></li><li><a href="global.html#MessageRequester">MessageRequester</a></li><li><a href="global.html#MetadataListener">MetadataListener</a></li><li><a href="global.html#MetadataRequester">MetadataRequester</a></li><li><a href="global.html#NextCall">NextCall</a></li><li><a href="global.html#StatusListener">StatusListener</a></li>
  54. </ul>
  55. </li>
  56. <li class="dropdown">
  57. <a href="externals.list.html" class="dropdown-toggle" data-toggle="dropdown">Externals<b class="caret"></b></a>
  58. <ul class="dropdown-menu ">
  59. <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>
  60. </ul>
  61. </li>
  62. </ul>
  63. <div class="col-sm-3 col-md-3">
  64. <form class="navbar-form" role="search">
  65. <div class="input-group">
  66. <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
  67. <div class="input-group-btn">
  68. <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="container" id="toc-content">
  77. <div class="row">
  78. <div class="col-md-8">
  79. <div id="main">
  80. <h1 class="page-title">Class: ClientWritableStream</h1>
  81. <section>
  82. <header>
  83. <h2>
  84. <span class="ancestors"><a href="grpc.html">grpc</a>~</span>
  85. ClientWritableStream
  86. </h2>
  87. </header>
  88. <article>
  89. <div class="container-overview">
  90. <hr>
  91. <dt>
  92. <h4 class="name" id="ClientWritableStream"><span class="type-signature"></span>new ClientWritableStream(call)</h4>
  93. </dt>
  94. <dd>
  95. <div class="description">
  96. <p>A stream that the client can write to. Used for calls that are streaming from
  97. the client side.</p>
  98. </div>
  99. <h5>Parameters:</h5>
  100. <table class="params table table-striped">
  101. <thead>
  102. <tr>
  103. <th>Name</th>
  104. <th>Type</th>
  105. <th class="last">Description</th>
  106. </tr>
  107. </thead>
  108. <tbody>
  109. <tr>
  110. <td class="name"><code>call</code></td>
  111. <td class="type">
  112. <span class="param-type">InterceptingCall</span>
  113. </td>
  114. <td class="description last"><p>Exposes gRPC request operations, processed by
  115. an interceptor stack.</p></td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. <dl class="details">
  120. </dl>
  121. </dd>
  122. </div>
  123. <h3 class="subsection-title">Extends</h3>
  124. <ul>
  125. <li><a href="external-Writable.html">external:Writable</a></li>
  126. </ul>
  127. <h3 class="subsection-title">Methods</h3>
  128. <dl>
  129. <hr>
  130. <dt>
  131. <h4 class="name" id="cancel"><span class="type-signature"></span>cancel()</h4>
  132. </dt>
  133. <dd>
  134. <div class="description">
  135. <p>Cancel the ongoing call. Results in the call ending with a CANCELLED status,
  136. unless it has already ended with some other status.</p>
  137. </div>
  138. <dl class="details">
  139. </dl>
  140. </dd>
  141. <hr>
  142. <dt>
  143. <h4 class="name" id="getPeer"><span class="type-signature"></span>getPeer()</h4>
  144. </dt>
  145. <dd>
  146. <div class="description">
  147. <p>Get the endpoint this call/stream is connected to.</p>
  148. </div>
  149. <dl class="details">
  150. </dl>
  151. <h5>Returns:</h5>
  152. <div class="param-desc">
  153. <p>The URI of the endpoint</p>
  154. </div>
  155. <dl>
  156. <dt>
  157. Type
  158. </dt>
  159. <dd>
  160. <span class="param-type">string</span>
  161. </dd>
  162. </dl>
  163. </dd>
  164. <hr>
  165. <dt>
  166. <h4 class="name" id="write"><span class="type-signature"></span>write(message, flags, callback)</h4>
  167. </dt>
  168. <dd>
  169. <div class="description">
  170. <p>Write a message to the request stream. If serializing the argument fails,
  171. the call will be cancelled and the stream will end with an error.</p>
  172. </div>
  173. <h5>Parameters:</h5>
  174. <table class="params table table-striped">
  175. <thead>
  176. <tr>
  177. <th>Name</th>
  178. <th>Type</th>
  179. <th class="last">Description</th>
  180. </tr>
  181. </thead>
  182. <tbody>
  183. <tr>
  184. <td class="name"><code>message</code></td>
  185. <td class="type">
  186. <span class="param-type">*</span>
  187. </td>
  188. <td class="description last"><p>The message to write. Must be a valid argument to the
  189. serialize function of the corresponding method</p></td>
  190. </tr>
  191. <tr>
  192. <td class="name"><code>flags</code></td>
  193. <td class="type">
  194. <span class="param-type"><a href="grpc.html#.writeFlags">grpc.writeFlags</a></span>
  195. </td>
  196. <td class="description last"><p>Flags to modify how the message is written</p></td>
  197. </tr>
  198. <tr>
  199. <td class="name"><code>callback</code></td>
  200. <td class="type">
  201. <span class="param-type">function</span>
  202. </td>
  203. <td class="description last"><p>Callback for when this chunk of data is flushed</p></td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. <dl class="details">
  208. </dl>
  209. <h5>Returns:</h5>
  210. <div class="param-desc">
  211. <p>As defined for <a href="external-Writable.html">Writable</a></p>
  212. </div>
  213. <dl>
  214. <dt>
  215. Type
  216. </dt>
  217. <dd>
  218. <span class="param-type">boolean</span>
  219. </dd>
  220. </dl>
  221. </dd>
  222. </dl>
  223. <h3 class="subsection-title">Events</h3>
  224. <dl>
  225. <hr>
  226. <dt>
  227. <h4 class="name" id="event:metadata">metadata</h4>
  228. </dt>
  229. <dd>
  230. <div class="description">
  231. <p>Initial response metadata sent by the server when it starts processing the
  232. call</p>
  233. </div>
  234. <h5>Type:
  235. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  236. </h5>
  237. <dl class="details">
  238. </dl>
  239. </dd>
  240. <hr>
  241. <dt>
  242. <h4 class="name" id="event:status">status</h4>
  243. </dt>
  244. <dd>
  245. <div class="description">
  246. <p>Status of the call when it has completed.</p>
  247. </div>
  248. <h5>Type:
  249. <span class="param-type"><a href="grpc.html#~StatusObject">grpc~StatusObject</a></span>
  250. </h5>
  251. <dl class="details">
  252. </dl>
  253. </dd>
  254. </dl>
  255. </article>
  256. </section>
  257. </div>
  258. </div>
  259. <div class="clearfix"></div>
  260. <div class="col-md-3">
  261. <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="modal fade" id="searchResults">
  266. <div class="modal-dialog">
  267. <div class="modal-content">
  268. <div class="modal-header">
  269. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  270. <h4 class="modal-title">Search results</h4>
  271. </div>
  272. <div class="modal-body"></div>
  273. <div class="modal-footer">
  274. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  275. </div>
  276. </div><!-- /.modal-content -->
  277. </div><!-- /.modal-dialog -->
  278. </div>
  279. <footer>
  280. <span class="jsdoc-message">
  281. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
  282. on 2019-07-15T16:38:16-07:00
  283. using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
  284. </span>
  285. </footer>
  286. <script src="scripts/docstrap.lib.js"></script>
  287. <script src="scripts/toc.js"></script>
  288. <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
  289. <script>
  290. $( function () {
  291. $( "[id*='$']" ).each( function () {
  292. var $this = $( this );
  293. $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
  294. } );
  295. $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
  296. var $this = $( this );
  297. var example = $this.find( "code" );
  298. exampleText = example.html();
  299. var lang = /{@lang (.*?)}/.exec( exampleText );
  300. if ( lang && lang[1] ) {
  301. exampleText = exampleText.replace( lang[0], "" );
  302. example.html( exampleText );
  303. lang = lang[1];
  304. } else {
  305. var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
  306. lang = langClassMatch ? langClassMatch[1] : "javascript";
  307. }
  308. if ( lang ) {
  309. $this
  310. .addClass( "sunlight-highlight-" + lang )
  311. .addClass( "linenums" )
  312. .html( example.html() );
  313. }
  314. } );
  315. Sunlight.highlightAll( {
  316. lineNumbers : false,
  317. showMenu : true,
  318. enableDoclinks : true
  319. } );
  320. $.catchAnchorLinks( {
  321. navbarOffset: 10
  322. } );
  323. $( "#toc" ).toc( {
  324. anchorName : function ( i, heading, prefix ) {
  325. return $( heading ).attr( "id" ) || ( prefix + i );
  326. },
  327. selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
  328. showAndHide : false,
  329. smoothScrolling: true
  330. } );
  331. $( "#main span[id^='toc']" ).addClass( "toc-shim" );
  332. $( '.dropdown-toggle' ).dropdown();
  333. $( "table" ).each( function () {
  334. var $this = $( this );
  335. $this.addClass('table');
  336. } );
  337. } );
  338. </script>
  339. <!--Navigation and Symbol Display-->
  340. <!--Google Analytics-->
  341. <script type="text/javascript">
  342. $(document).ready(function() {
  343. SearcherDisplay.init();
  344. });
  345. </script>
  346. </body>
  347. </html>