grpc.Client.html 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Client</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: Client</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>Client<span class="signature">(address, credentials, options)</span><span class="type-signature"></span></h2>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h4 class="name" id="Client"><span class="type-signature"></span>new Client<span class="signature">(address, credentials, options)</span><span class="type-signature"></span></h4>
  25. <div class="description">
  26. <p>A generic gRPC client. Primarily useful as a base class for generated clients</p>
  27. </div>
  28. <h5>Parameters:</h5>
  29. <table class="params">
  30. <thead>
  31. <tr>
  32. <th>Name</th>
  33. <th>Type</th>
  34. <th class="last">Description</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <tr>
  39. <td class="name"><code>address</code></td>
  40. <td class="type">
  41. <span class="param-type">string</span>
  42. </td>
  43. <td class="description last"><p>Server address to connect to</p></td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>credentials</code></td>
  47. <td class="type">
  48. <span class="param-type">grpc~ChannelCredentials</span>
  49. </td>
  50. <td class="description last"><p>Credentials to use to connect to
  51. the server</p></td>
  52. </tr>
  53. <tr>
  54. <td class="name"><code>options</code></td>
  55. <td class="type">
  56. <span class="param-type">Object</span>
  57. </td>
  58. <td class="description last"><p>Options to apply to channel creation</p></td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. <dl class="details">
  63. <dt class="tag-source">Source:</dt>
  64. <dd class="tag-source"><ul class="dummy"><li>
  65. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line457">line 457</a>
  66. </li></ul></dd>
  67. </dl>
  68. </div>
  69. <h3 class="subsection-title">Methods</h3>
  70. <h4 class="name" id="close"><span class="type-signature"></span>close<span class="signature">()</span><span class="type-signature"></span></h4>
  71. <div class="description">
  72. <p>Close this client.</p>
  73. </div>
  74. <dl class="details">
  75. <dt class="tag-source">Source:</dt>
  76. <dd class="tag-source"><ul class="dummy"><li>
  77. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line765">line 765</a>
  78. </li></ul></dd>
  79. </dl>
  80. <h4 class="name" id="getChannel"><span class="type-signature"></span>getChannel<span class="signature">()</span><span class="type-signature"> &rarr; {Channel}</span></h4>
  81. <div class="description">
  82. <p>Return the underlying channel object for the specified client</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-source">Source:</dt>
  86. <dd class="tag-source"><ul class="dummy"><li>
  87. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line773">line 773</a>
  88. </li></ul></dd>
  89. </dl>
  90. <h5>Returns:</h5>
  91. <div class="param-desc">
  92. <p>The channel</p>
  93. </div>
  94. <dl>
  95. <dt>
  96. Type
  97. </dt>
  98. <dd>
  99. <span class="param-type">Channel</span>
  100. </dd>
  101. </dl>
  102. <h4 class="name" id="makeBidiStreamRequest"><span class="type-signature"></span>makeBidiStreamRequest<span class="signature">(method, serialize, deserialize, metadata<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a>}</span></h4>
  103. <div class="description">
  104. <p>Make a bidirectional stream request with this method on the given channel.</p>
  105. </div>
  106. <h5>Parameters:</h5>
  107. <table class="params">
  108. <thead>
  109. <tr>
  110. <th>Name</th>
  111. <th>Type</th>
  112. <th>Attributes</th>
  113. <th class="last">Description</th>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. <tr>
  118. <td class="name"><code>method</code></td>
  119. <td class="type">
  120. <span class="param-type">string</span>
  121. </td>
  122. <td class="attributes">
  123. </td>
  124. <td class="description last"><p>The name of the method to request</p></td>
  125. </tr>
  126. <tr>
  127. <td class="name"><code>serialize</code></td>
  128. <td class="type">
  129. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  130. </td>
  131. <td class="attributes">
  132. </td>
  133. <td class="description last"><p>The serialization function for inputs</p></td>
  134. </tr>
  135. <tr>
  136. <td class="name"><code>deserialize</code></td>
  137. <td class="type">
  138. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  139. </td>
  140. <td class="attributes">
  141. </td>
  142. <td class="description last"><p>The deserialization
  143. function for outputs</p></td>
  144. </tr>
  145. <tr>
  146. <td class="name"><code>metadata</code></td>
  147. <td class="type">
  148. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  149. </td>
  150. <td class="attributes">
  151. &lt;optional><br>
  152. </td>
  153. <td class="description last"><p>Array of metadata key/value
  154. pairs to add to the call</p></td>
  155. </tr>
  156. <tr>
  157. <td class="name"><code>options</code></td>
  158. <td class="type">
  159. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  160. </td>
  161. <td class="attributes">
  162. &lt;optional><br>
  163. </td>
  164. <td class="description last"><p>Options map</p></td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. <dl class="details">
  169. <dt class="tag-source">Source:</dt>
  170. <dd class="tag-source"><ul class="dummy"><li>
  171. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line722">line 722</a>
  172. </li></ul></dd>
  173. </dl>
  174. <h5>Returns:</h5>
  175. <div class="param-desc">
  176. <p>An event emitter for stream related events</p>
  177. </div>
  178. <dl>
  179. <dt>
  180. Type
  181. </dt>
  182. <dd>
  183. <span class="param-type"><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></span>
  184. </dd>
  185. </dl>
  186. <h4 class="name" id="makeClientStreamRequest"><span class="type-signature"></span>makeClientStreamRequest<span class="signature">(method, serialize, deserialize, metadata<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"> &rarr; {<a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a>}</span></h4>
  187. <div class="description">
  188. <p>Make a client stream request to the given method, using the given serialize
  189. and deserialize functions, with the given argument.</p>
  190. </div>
  191. <h5>Parameters:</h5>
  192. <table class="params">
  193. <thead>
  194. <tr>
  195. <th>Name</th>
  196. <th>Type</th>
  197. <th>Attributes</th>
  198. <th class="last">Description</th>
  199. </tr>
  200. </thead>
  201. <tbody>
  202. <tr>
  203. <td class="name"><code>method</code></td>
  204. <td class="type">
  205. <span class="param-type">string</span>
  206. </td>
  207. <td class="attributes">
  208. </td>
  209. <td class="description last"><p>The name of the method to request</p></td>
  210. </tr>
  211. <tr>
  212. <td class="name"><code>serialize</code></td>
  213. <td class="type">
  214. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  215. </td>
  216. <td class="attributes">
  217. </td>
  218. <td class="description last"><p>The serialization function for
  219. inputs</p></td>
  220. </tr>
  221. <tr>
  222. <td class="name"><code>deserialize</code></td>
  223. <td class="type">
  224. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  225. </td>
  226. <td class="attributes">
  227. </td>
  228. <td class="description last"><p>The deserialization
  229. function for outputs</p></td>
  230. </tr>
  231. <tr>
  232. <td class="name"><code>metadata</code></td>
  233. <td class="type">
  234. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  235. </td>
  236. <td class="attributes">
  237. &lt;optional><br>
  238. </td>
  239. <td class="description last"><p>Array of metadata key/value pairs to add to
  240. the call</p></td>
  241. </tr>
  242. <tr>
  243. <td class="name"><code>options</code></td>
  244. <td class="type">
  245. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  246. </td>
  247. <td class="attributes">
  248. &lt;optional><br>
  249. </td>
  250. <td class="description last"><p>Options map</p></td>
  251. </tr>
  252. <tr>
  253. <td class="name"><code>callback</code></td>
  254. <td class="type">
  255. <span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
  256. </td>
  257. <td class="attributes">
  258. </td>
  259. <td class="description last"><p>The callback to for when the
  260. response is received</p></td>
  261. </tr>
  262. </tbody>
  263. </table>
  264. <dl class="details">
  265. <dt class="tag-source">Source:</dt>
  266. <dd class="tag-source"><ul class="dummy"><li>
  267. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line582">line 582</a>
  268. </li></ul></dd>
  269. </dl>
  270. <h5>Returns:</h5>
  271. <div class="param-desc">
  272. <p>An event emitter for stream related
  273. events</p>
  274. </div>
  275. <dl>
  276. <dt>
  277. Type
  278. </dt>
  279. <dd>
  280. <span class="param-type"><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></span>
  281. </dd>
  282. </dl>
  283. <h4 class="name" id="makeServerStreamRequest"><span class="type-signature"></span>makeServerStreamRequest<span class="signature">(method, serialize, deserialize, argument, metadata<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a>}</span></h4>
  284. <div class="description">
  285. <p>Make a server stream request to the given method, with the given serialize
  286. and deserialize function, using the given argument</p>
  287. </div>
  288. <h5>Parameters:</h5>
  289. <table class="params">
  290. <thead>
  291. <tr>
  292. <th>Name</th>
  293. <th>Type</th>
  294. <th>Attributes</th>
  295. <th class="last">Description</th>
  296. </tr>
  297. </thead>
  298. <tbody>
  299. <tr>
  300. <td class="name"><code>method</code></td>
  301. <td class="type">
  302. <span class="param-type">string</span>
  303. </td>
  304. <td class="attributes">
  305. </td>
  306. <td class="description last"><p>The name of the method to request</p></td>
  307. </tr>
  308. <tr>
  309. <td class="name"><code>serialize</code></td>
  310. <td class="type">
  311. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  312. </td>
  313. <td class="attributes">
  314. </td>
  315. <td class="description last"><p>The serialization function for inputs</p></td>
  316. </tr>
  317. <tr>
  318. <td class="name"><code>deserialize</code></td>
  319. <td class="type">
  320. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  321. </td>
  322. <td class="attributes">
  323. </td>
  324. <td class="description last"><p>The deserialization
  325. function for outputs</p></td>
  326. </tr>
  327. <tr>
  328. <td class="name"><code>argument</code></td>
  329. <td class="type">
  330. <span class="param-type">*</span>
  331. </td>
  332. <td class="attributes">
  333. </td>
  334. <td class="description last"><p>The argument to the call. Should be serializable with
  335. serialize</p></td>
  336. </tr>
  337. <tr>
  338. <td class="name"><code>metadata</code></td>
  339. <td class="type">
  340. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  341. </td>
  342. <td class="attributes">
  343. &lt;optional><br>
  344. </td>
  345. <td class="description last"><p>Array of metadata key/value pairs to add to
  346. the call</p></td>
  347. </tr>
  348. <tr>
  349. <td class="name"><code>options</code></td>
  350. <td class="type">
  351. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  352. </td>
  353. <td class="attributes">
  354. &lt;optional><br>
  355. </td>
  356. <td class="description last"><p>Options map</p></td>
  357. </tr>
  358. </tbody>
  359. </table>
  360. <dl class="details">
  361. <dt class="tag-source">Source:</dt>
  362. <dd class="tag-source"><ul class="dummy"><li>
  363. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line664">line 664</a>
  364. </li></ul></dd>
  365. </dl>
  366. <h5>Returns:</h5>
  367. <div class="param-desc">
  368. <p>An event emitter for stream related
  369. events</p>
  370. </div>
  371. <dl>
  372. <dt>
  373. Type
  374. </dt>
  375. <dd>
  376. <span class="param-type"><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></span>
  377. </dd>
  378. </dl>
  379. <h4 class="name" id="makeUnaryRequest"><span class="type-signature"></span>makeUnaryRequest<span class="signature">(method, serialize, deserialize, argument, metadata<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"> &rarr; {<a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a>}</span></h4>
  380. <div class="description">
  381. <p>Make a unary request to the given method, using the given serialize
  382. and deserialize functions, with the given argument.</p>
  383. </div>
  384. <h5>Parameters:</h5>
  385. <table class="params">
  386. <thead>
  387. <tr>
  388. <th>Name</th>
  389. <th>Type</th>
  390. <th>Attributes</th>
  391. <th class="last">Description</th>
  392. </tr>
  393. </thead>
  394. <tbody>
  395. <tr>
  396. <td class="name"><code>method</code></td>
  397. <td class="type">
  398. <span class="param-type">string</span>
  399. </td>
  400. <td class="attributes">
  401. </td>
  402. <td class="description last"><p>The name of the method to request</p></td>
  403. </tr>
  404. <tr>
  405. <td class="name"><code>serialize</code></td>
  406. <td class="type">
  407. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  408. </td>
  409. <td class="attributes">
  410. </td>
  411. <td class="description last"><p>The serialization function for
  412. inputs</p></td>
  413. </tr>
  414. <tr>
  415. <td class="name"><code>deserialize</code></td>
  416. <td class="type">
  417. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  418. </td>
  419. <td class="attributes">
  420. </td>
  421. <td class="description last"><p>The deserialization
  422. function for outputs</p></td>
  423. </tr>
  424. <tr>
  425. <td class="name"><code>argument</code></td>
  426. <td class="type">
  427. <span class="param-type">*</span>
  428. </td>
  429. <td class="attributes">
  430. </td>
  431. <td class="description last"><p>The argument to the call. Should be serializable with
  432. serialize</p></td>
  433. </tr>
  434. <tr>
  435. <td class="name"><code>metadata</code></td>
  436. <td class="type">
  437. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  438. </td>
  439. <td class="attributes">
  440. &lt;optional><br>
  441. </td>
  442. <td class="description last"><p>Metadata to add to the call</p></td>
  443. </tr>
  444. <tr>
  445. <td class="name"><code>options</code></td>
  446. <td class="type">
  447. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  448. </td>
  449. <td class="attributes">
  450. &lt;optional><br>
  451. </td>
  452. <td class="description last"><p>Options map</p></td>
  453. </tr>
  454. <tr>
  455. <td class="name"><code>callback</code></td>
  456. <td class="type">
  457. <span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
  458. </td>
  459. <td class="attributes">
  460. </td>
  461. <td class="description last"><p>The callback to
  462. for when the response is received</p></td>
  463. </tr>
  464. </tbody>
  465. </table>
  466. <dl class="details">
  467. <dt class="tag-source">Source:</dt>
  468. <dd class="tag-source"><ul class="dummy"><li>
  469. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line500">line 500</a>
  470. </li></ul></dd>
  471. </dl>
  472. <h5>Returns:</h5>
  473. <div class="param-desc">
  474. <p>An event emitter for stream related events</p>
  475. </div>
  476. <dl>
  477. <dt>
  478. Type
  479. </dt>
  480. <dd>
  481. <span class="param-type"><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></span>
  482. </dd>
  483. </dl>
  484. <h4 class="name" id="waitForReady"><span class="type-signature"></span>waitForReady<span class="signature">(deadline, callback)</span><span class="type-signature"></span></h4>
  485. <div class="description">
  486. <p>Wait for the client to be ready. The callback will be called when the
  487. client has successfully connected to the server, and it will be called
  488. with an error if the attempt to connect to the server has unrecoverablly
  489. failed or if the deadline expires. This function will make the channel
  490. start connecting if it has not already done so.</p>
  491. </div>
  492. <h5>Parameters:</h5>
  493. <table class="params">
  494. <thead>
  495. <tr>
  496. <th>Name</th>
  497. <th>Type</th>
  498. <th class="last">Description</th>
  499. </tr>
  500. </thead>
  501. <tbody>
  502. <tr>
  503. <td class="name"><code>deadline</code></td>
  504. <td class="type">
  505. <span class="param-type"><a href="grpc.html#~Deadline">grpc~Deadline</a></span>
  506. </td>
  507. <td class="description last"><p>When to stop waiting for a connection.</p></td>
  508. </tr>
  509. <tr>
  510. <td class="name"><code>callback</code></td>
  511. <td class="type">
  512. <span class="param-type">function</span>
  513. </td>
  514. <td class="description last"><p>The callback to call when done attempting
  515. to connect.</p></td>
  516. </tr>
  517. </tbody>
  518. </table>
  519. <dl class="details">
  520. <dt class="tag-source">Source:</dt>
  521. <dd class="tag-source"><ul class="dummy"><li>
  522. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line787">line 787</a>
  523. </li></ul></dd>
  524. </dl>
  525. <h3 class="subsection-title">Type Definitions</h3>
  526. <h4 class="name" id="~Call">Call</h4>
  527. <div class="description">
  528. <p>Any client call type</p>
  529. </div>
  530. <h5>Type:</h5>
  531. <ul>
  532. <li>
  533. <span class="param-type">ClientUnaryCall</span>
  534. |
  535. <span class="param-type">ClientReadableStream</span>
  536. |
  537. <span class="param-type">ClientWritableStream</span>
  538. |
  539. <span class="param-type">ClientDuplexStream</span>
  540. </li>
  541. </ul>
  542. <dl class="details">
  543. <dt class="tag-source">Source:</dt>
  544. <dd class="tag-source"><ul class="dummy"><li>
  545. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line394">line 394</a>
  546. </li></ul></dd>
  547. </dl>
  548. <h4 class="name" id="~CallOptions">CallOptions</h4>
  549. <div class="description">
  550. <p>Options that can be set on a call.</p>
  551. </div>
  552. <h5>Type:</h5>
  553. <ul>
  554. <li>
  555. <span class="param-type">Object</span>
  556. </li>
  557. </ul>
  558. <h5 class="subsection-title">Properties:</h5>
  559. <table class="props">
  560. <thead>
  561. <tr>
  562. <th>Name</th>
  563. <th>Type</th>
  564. <th class="last">Description</th>
  565. </tr>
  566. </thead>
  567. <tbody>
  568. <tr>
  569. <td class="name"><code>deadline</code></td>
  570. <td class="type">
  571. <span class="param-type"><a href="grpc.html#~Deadline">grpc~Deadline</a></span>
  572. </td>
  573. <td class="description last"><p>The deadline for the entire call to
  574. complete.</p></td>
  575. </tr>
  576. <tr>
  577. <td class="name"><code>host</code></td>
  578. <td class="type">
  579. <span class="param-type">string</span>
  580. </td>
  581. <td class="description last"><p>Server hostname to set on the call. Only meaningful
  582. if different from the server address used to construct the client.</p></td>
  583. </tr>
  584. <tr>
  585. <td class="name"><code>parent</code></td>
  586. <td class="type">
  587. <span class="param-type"><a href="grpc.Client.html#~Call">grpc.Client~Call</a></span>
  588. </td>
  589. <td class="description last"><p>Parent call. Used in servers when
  590. making a call as part of the process of handling a call. Used to
  591. propagate some information automatically, as specified by
  592. propagate_flags.</p></td>
  593. </tr>
  594. <tr>
  595. <td class="name"><code>propagate_flags</code></td>
  596. <td class="type">
  597. <span class="param-type">number</span>
  598. </td>
  599. <td class="description last"><p>Indicates which properties of a parent
  600. call should propagate to this call. Bitwise combination of flags in
  601. <a href="grpc.html#.propagate">grpc.propagate</a>.</p></td>
  602. </tr>
  603. <tr>
  604. <td class="name"><code>credentials</code></td>
  605. <td class="type">
  606. <span class="param-type"><a href="grpc.credentials-CallCredentials.html">grpc.credentials~CallCredentials</a></span>
  607. </td>
  608. <td class="description last"><p>The credentials that
  609. should be used to make this particular call.</p></td>
  610. </tr>
  611. </tbody>
  612. </table>
  613. <dl class="details">
  614. <dt class="tag-source">Source:</dt>
  615. <dd class="tag-source"><ul class="dummy"><li>
  616. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line401">line 401</a>
  617. </li></ul></dd>
  618. </dl>
  619. <h4 class="name" id="~requestCallback"><span class="type-signature"></span>requestCallback<span class="signature">(error<span class="signature-attributes">nullable</span>, value)</span><span class="type-signature"></span></h4>
  620. <h5>Parameters:</h5>
  621. <table class="params">
  622. <thead>
  623. <tr>
  624. <th>Name</th>
  625. <th>Type</th>
  626. <th>Attributes</th>
  627. <th class="last">Description</th>
  628. </tr>
  629. </thead>
  630. <tbody>
  631. <tr>
  632. <td class="name"><code>error</code></td>
  633. <td class="type">
  634. <span class="param-type"><a href="grpc.html#~ServiceError">grpc~ServiceError</a></span>
  635. </td>
  636. <td class="attributes">
  637. &lt;nullable><br>
  638. </td>
  639. <td class="description last"><p>The error, if the call
  640. failed</p></td>
  641. </tr>
  642. <tr>
  643. <td class="name"><code>value</code></td>
  644. <td class="type">
  645. <span class="param-type">*</span>
  646. </td>
  647. <td class="attributes">
  648. </td>
  649. <td class="description last"><p>The response value, if the call succeeded</p></td>
  650. </tr>
  651. </tbody>
  652. </table>
  653. <dl class="details">
  654. <dt class="tag-source">Source:</dt>
  655. <dd class="tag-source"><ul class="dummy"><li>
  656. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line477">line 477</a>
  657. </li></ul></dd>
  658. </dl>
  659. </article>
  660. </section>
  661. </div>
  662. <nav>
  663. <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>
  664. </nav>
  665. <br class="clear">
  666. <footer>
  667. 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)
  668. </footer>
  669. <script> prettyPrint(); </script>
  670. <script src="scripts/linenumber.js"> </script>
  671. </body>
  672. </html>