grpc.Client.html 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582
  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: Client</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: Client</h1>
  69. <section>
  70. <header>
  71. <h2>
  72. <span class="ancestors"><a href="grpc.html">grpc</a>.</span>
  73. Client
  74. </h2>
  75. </header>
  76. <article>
  77. <div class="container-overview">
  78. <hr>
  79. <dt>
  80. <h4 class="name" id="Client"><span class="type-signature"></span>new Client(address, credentials, options)</h4>
  81. </dt>
  82. <dd>
  83. <div class="description">
  84. <p>A generic gRPC client. Primarily useful as a base class for generated clients</p>
  85. </div>
  86. <h5>Parameters:</h5>
  87. <table class="params table table-striped">
  88. <thead>
  89. <tr>
  90. <th>Name</th>
  91. <th>Type</th>
  92. <th class="last">Description</th>
  93. </tr>
  94. </thead>
  95. <tbody>
  96. <tr>
  97. <td class="name"><code>address</code></td>
  98. <td class="type">
  99. <span class="param-type">string</span>
  100. </td>
  101. <td class="description last"><p>Server address to connect to</p></td>
  102. </tr>
  103. <tr>
  104. <td class="name"><code>credentials</code></td>
  105. <td class="type">
  106. <span class="param-type"><a href="grpc.credentials-ChannelCredentials.html">grpc.credentials~ChannelCredentials</a></span>
  107. </td>
  108. <td class="description last"><p>Credentials to use to connect to
  109. the server</p></td>
  110. </tr>
  111. <tr>
  112. <td class="name"><code>options</code></td>
  113. <td class="type">
  114. <span class="param-type">Object</span>
  115. </td>
  116. <td class="description last"><p>Options to apply to channel creation</p></td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <dl class="details">
  121. </dl>
  122. </dd>
  123. </div>
  124. <h3 class="subsection-title">Methods</h3>
  125. <dl>
  126. <hr>
  127. <dt>
  128. <h4 class="name" id="close"><span class="type-signature"></span>close()</h4>
  129. </dt>
  130. <dd>
  131. <div class="description">
  132. <p>Close this client.</p>
  133. </div>
  134. <dl class="details">
  135. </dl>
  136. </dd>
  137. <hr>
  138. <dt>
  139. <h4 class="name" id="getChannel"><span class="type-signature"></span>getChannel()</h4>
  140. </dt>
  141. <dd>
  142. <div class="description">
  143. <p>Return the underlying channel object for the specified client</p>
  144. </div>
  145. <dl class="details">
  146. </dl>
  147. <h5>Returns:</h5>
  148. <div class="param-desc">
  149. <p>The channel</p>
  150. </div>
  151. <dl>
  152. <dt>
  153. Type
  154. </dt>
  155. <dd>
  156. <span class="param-type">Channel</span>
  157. </dd>
  158. </dl>
  159. </dd>
  160. <hr>
  161. <dt>
  162. <h4 class="name" id="makeBidiStreamRequest"><span class="type-signature"></span>makeBidiStreamRequest(method, serialize, deserialize [, metadata] [, options])</h4>
  163. </dt>
  164. <dd>
  165. <div class="description">
  166. <p>Make a bidirectional stream request with this method on the given channel.</p>
  167. </div>
  168. <h5>Parameters:</h5>
  169. <table class="params table table-striped">
  170. <thead>
  171. <tr>
  172. <th>Name</th>
  173. <th>Type</th>
  174. <th>Argument</th>
  175. <th class="last">Description</th>
  176. </tr>
  177. </thead>
  178. <tbody>
  179. <tr>
  180. <td class="name"><code>method</code></td>
  181. <td class="type">
  182. <span class="param-type">string</span>
  183. </td>
  184. <td class="attributes">
  185. </td>
  186. <td class="description last"><p>The name of the method to request</p></td>
  187. </tr>
  188. <tr>
  189. <td class="name"><code>serialize</code></td>
  190. <td class="type">
  191. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  192. </td>
  193. <td class="attributes">
  194. </td>
  195. <td class="description last"><p>The serialization function for inputs</p></td>
  196. </tr>
  197. <tr>
  198. <td class="name"><code>deserialize</code></td>
  199. <td class="type">
  200. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  201. </td>
  202. <td class="attributes">
  203. </td>
  204. <td class="description last"><p>The deserialization
  205. function for outputs</p></td>
  206. </tr>
  207. <tr>
  208. <td class="name"><code>metadata</code></td>
  209. <td class="type">
  210. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  211. </td>
  212. <td class="attributes">
  213. &lt;optional><br>
  214. </td>
  215. <td class="description last"><p>Array of metadata key/value
  216. pairs to add to the call</p></td>
  217. </tr>
  218. <tr>
  219. <td class="name"><code>options</code></td>
  220. <td class="type">
  221. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  222. </td>
  223. <td class="attributes">
  224. &lt;optional><br>
  225. </td>
  226. <td class="description last"><p>Options map</p></td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. <dl class="details">
  231. </dl>
  232. <h5>Returns:</h5>
  233. <div class="param-desc">
  234. <p>An event emitter for stream related events</p>
  235. </div>
  236. <dl>
  237. <dt>
  238. Type
  239. </dt>
  240. <dd>
  241. <span class="param-type"><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></span>
  242. </dd>
  243. </dl>
  244. </dd>
  245. <hr>
  246. <dt>
  247. <h4 class="name" id="makeClientStreamRequest"><span class="type-signature"></span>makeClientStreamRequest(method, serialize, deserialize [, metadata] [, options], callback)</h4>
  248. </dt>
  249. <dd>
  250. <div class="description">
  251. <p>Make a client stream request to the given method, using the given serialize
  252. and deserialize functions, with the given argument.</p>
  253. </div>
  254. <h5>Parameters:</h5>
  255. <table class="params table table-striped">
  256. <thead>
  257. <tr>
  258. <th>Name</th>
  259. <th>Type</th>
  260. <th>Argument</th>
  261. <th class="last">Description</th>
  262. </tr>
  263. </thead>
  264. <tbody>
  265. <tr>
  266. <td class="name"><code>method</code></td>
  267. <td class="type">
  268. <span class="param-type">string</span>
  269. </td>
  270. <td class="attributes">
  271. </td>
  272. <td class="description last"><p>The name of the method to request</p></td>
  273. </tr>
  274. <tr>
  275. <td class="name"><code>serialize</code></td>
  276. <td class="type">
  277. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  278. </td>
  279. <td class="attributes">
  280. </td>
  281. <td class="description last"><p>The serialization function for
  282. inputs</p></td>
  283. </tr>
  284. <tr>
  285. <td class="name"><code>deserialize</code></td>
  286. <td class="type">
  287. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  288. </td>
  289. <td class="attributes">
  290. </td>
  291. <td class="description last"><p>The deserialization
  292. function for outputs</p></td>
  293. </tr>
  294. <tr>
  295. <td class="name"><code>metadata</code></td>
  296. <td class="type">
  297. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  298. </td>
  299. <td class="attributes">
  300. &lt;optional><br>
  301. </td>
  302. <td class="description last"><p>Array of metadata key/value pairs to add to
  303. the call</p></td>
  304. </tr>
  305. <tr>
  306. <td class="name"><code>options</code></td>
  307. <td class="type">
  308. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  309. </td>
  310. <td class="attributes">
  311. &lt;optional><br>
  312. </td>
  313. <td class="description last"><p>Options map</p></td>
  314. </tr>
  315. <tr>
  316. <td class="name"><code>callback</code></td>
  317. <td class="type">
  318. <span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
  319. </td>
  320. <td class="attributes">
  321. </td>
  322. <td class="description last"><p>The callback to for when the
  323. response is received</p></td>
  324. </tr>
  325. </tbody>
  326. </table>
  327. <dl class="details">
  328. </dl>
  329. <h5>Returns:</h5>
  330. <div class="param-desc">
  331. <p>An event emitter for stream related
  332. events</p>
  333. </div>
  334. <dl>
  335. <dt>
  336. Type
  337. </dt>
  338. <dd>
  339. <span class="param-type"><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></span>
  340. </dd>
  341. </dl>
  342. </dd>
  343. <hr>
  344. <dt>
  345. <h4 class="name" id="makeServerStreamRequest"><span class="type-signature"></span>makeServerStreamRequest(method, serialize, deserialize, argument [, metadata] [, options])</h4>
  346. </dt>
  347. <dd>
  348. <div class="description">
  349. <p>Make a server stream request to the given method, with the given serialize
  350. and deserialize function, using the given argument</p>
  351. </div>
  352. <h5>Parameters:</h5>
  353. <table class="params table table-striped">
  354. <thead>
  355. <tr>
  356. <th>Name</th>
  357. <th>Type</th>
  358. <th>Argument</th>
  359. <th class="last">Description</th>
  360. </tr>
  361. </thead>
  362. <tbody>
  363. <tr>
  364. <td class="name"><code>method</code></td>
  365. <td class="type">
  366. <span class="param-type">string</span>
  367. </td>
  368. <td class="attributes">
  369. </td>
  370. <td class="description last"><p>The name of the method to request</p></td>
  371. </tr>
  372. <tr>
  373. <td class="name"><code>serialize</code></td>
  374. <td class="type">
  375. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  376. </td>
  377. <td class="attributes">
  378. </td>
  379. <td class="description last"><p>The serialization function for inputs</p></td>
  380. </tr>
  381. <tr>
  382. <td class="name"><code>deserialize</code></td>
  383. <td class="type">
  384. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  385. </td>
  386. <td class="attributes">
  387. </td>
  388. <td class="description last"><p>The deserialization
  389. function for outputs</p></td>
  390. </tr>
  391. <tr>
  392. <td class="name"><code>argument</code></td>
  393. <td class="type">
  394. <span class="param-type">*</span>
  395. </td>
  396. <td class="attributes">
  397. </td>
  398. <td class="description last"><p>The argument to the call. Should be serializable with
  399. serialize</p></td>
  400. </tr>
  401. <tr>
  402. <td class="name"><code>metadata</code></td>
  403. <td class="type">
  404. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  405. </td>
  406. <td class="attributes">
  407. &lt;optional><br>
  408. </td>
  409. <td class="description last"><p>Array of metadata key/value pairs to add to
  410. the call</p></td>
  411. </tr>
  412. <tr>
  413. <td class="name"><code>options</code></td>
  414. <td class="type">
  415. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  416. </td>
  417. <td class="attributes">
  418. &lt;optional><br>
  419. </td>
  420. <td class="description last"><p>Options map</p></td>
  421. </tr>
  422. </tbody>
  423. </table>
  424. <dl class="details">
  425. </dl>
  426. <h5>Returns:</h5>
  427. <div class="param-desc">
  428. <p>An event emitter for stream related
  429. events</p>
  430. </div>
  431. <dl>
  432. <dt>
  433. Type
  434. </dt>
  435. <dd>
  436. <span class="param-type"><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></span>
  437. </dd>
  438. </dl>
  439. </dd>
  440. <hr>
  441. <dt>
  442. <h4 class="name" id="makeUnaryRequest"><span class="type-signature"></span>makeUnaryRequest(method, serialize, deserialize, argument [, metadata] [, options], callback)</h4>
  443. </dt>
  444. <dd>
  445. <div class="description">
  446. <p>Make a unary request to the given method, using the given serialize
  447. and deserialize functions, with the given argument.</p>
  448. </div>
  449. <h5>Parameters:</h5>
  450. <table class="params table table-striped">
  451. <thead>
  452. <tr>
  453. <th>Name</th>
  454. <th>Type</th>
  455. <th>Argument</th>
  456. <th class="last">Description</th>
  457. </tr>
  458. </thead>
  459. <tbody>
  460. <tr>
  461. <td class="name"><code>method</code></td>
  462. <td class="type">
  463. <span class="param-type">string</span>
  464. </td>
  465. <td class="attributes">
  466. </td>
  467. <td class="description last"><p>The name of the method to request</p></td>
  468. </tr>
  469. <tr>
  470. <td class="name"><code>serialize</code></td>
  471. <td class="type">
  472. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  473. </td>
  474. <td class="attributes">
  475. </td>
  476. <td class="description last"><p>The serialization function for
  477. inputs</p></td>
  478. </tr>
  479. <tr>
  480. <td class="name"><code>deserialize</code></td>
  481. <td class="type">
  482. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  483. </td>
  484. <td class="attributes">
  485. </td>
  486. <td class="description last"><p>The deserialization
  487. function for outputs</p></td>
  488. </tr>
  489. <tr>
  490. <td class="name"><code>argument</code></td>
  491. <td class="type">
  492. <span class="param-type">*</span>
  493. </td>
  494. <td class="attributes">
  495. </td>
  496. <td class="description last"><p>The argument to the call. Should be serializable with
  497. serialize</p></td>
  498. </tr>
  499. <tr>
  500. <td class="name"><code>metadata</code></td>
  501. <td class="type">
  502. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  503. </td>
  504. <td class="attributes">
  505. &lt;optional><br>
  506. </td>
  507. <td class="description last"><p>Metadata to add to the call</p></td>
  508. </tr>
  509. <tr>
  510. <td class="name"><code>options</code></td>
  511. <td class="type">
  512. <span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
  513. </td>
  514. <td class="attributes">
  515. &lt;optional><br>
  516. </td>
  517. <td class="description last"><p>Options map</p></td>
  518. </tr>
  519. <tr>
  520. <td class="name"><code>callback</code></td>
  521. <td class="type">
  522. <span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
  523. </td>
  524. <td class="attributes">
  525. </td>
  526. <td class="description last"><p>The callback to
  527. for when the response is received</p></td>
  528. </tr>
  529. </tbody>
  530. </table>
  531. <dl class="details">
  532. </dl>
  533. <h5>Returns:</h5>
  534. <div class="param-desc">
  535. <p>An event emitter for stream related events</p>
  536. </div>
  537. <dl>
  538. <dt>
  539. Type
  540. </dt>
  541. <dd>
  542. <span class="param-type"><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></span>
  543. </dd>
  544. </dl>
  545. </dd>
  546. <hr>
  547. <dt>
  548. <h4 class="name" id="waitForReady"><span class="type-signature"></span>waitForReady(deadline, callback)</h4>
  549. </dt>
  550. <dd>
  551. <div class="description">
  552. <p>Wait for the client to be ready. The callback will be called when the
  553. client has successfully connected to the server, and it will be called
  554. with an error if the attempt to connect to the server has unrecoverablly
  555. failed or if the deadline expires. This function will make the channel
  556. start connecting if it has not already done so.</p>
  557. </div>
  558. <h5>Parameters:</h5>
  559. <table class="params table table-striped">
  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>When to stop waiting for a connection.</p></td>
  574. </tr>
  575. <tr>
  576. <td class="name"><code>callback</code></td>
  577. <td class="type">
  578. <span class="param-type">function</span>
  579. </td>
  580. <td class="description last"><p>The callback to call when done attempting
  581. to connect.</p></td>
  582. </tr>
  583. </tbody>
  584. </table>
  585. <dl class="details">
  586. </dl>
  587. </dd>
  588. </dl>
  589. <h3 class="subsection-title">Type Definitions</h3>
  590. <dl>
  591. <hr>
  592. <dt class="name" id="~Call">
  593. <h4 id="~Call">Call</h4>
  594. </dt>
  595. <dd>
  596. <div class="description">
  597. <p>Any client call type</p>
  598. </div>
  599. <h5>Type:</h5>
  600. <ul>
  601. <li>
  602. <span class="param-type"><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></span>
  603. |
  604. <span class="param-type"><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></span>
  605. |
  606. <span class="param-type"><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></span>
  607. |
  608. <span class="param-type"><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></span>
  609. </li>
  610. </ul>
  611. <dl class="details">
  612. </dl>
  613. </dd>
  614. <hr>
  615. <dt class="name" id="~CallOptions">
  616. <h4 id="~CallOptions">CallOptions</h4>
  617. </dt>
  618. <dd>
  619. <div class="description">
  620. <p>Options that can be set on a call.</p>
  621. </div>
  622. <h5>Type:</h5>
  623. <ul>
  624. <li>
  625. <span class="param-type">Object</span>
  626. </li>
  627. </ul>
  628. <dl class="details">
  629. <h5 class="subsection-title">Properties:</h5>
  630. <dl>
  631. <table class="props table table-striped">
  632. <thead>
  633. <tr>
  634. <th>Name</th>
  635. <th>Type</th>
  636. <th class="last">Description</th>
  637. </tr>
  638. </thead>
  639. <tbody>
  640. <tr>
  641. <td class="name"><code>deadline</code></td>
  642. <td class="type">
  643. <span class="param-type"><a href="grpc.html#~Deadline">grpc~Deadline</a></span>
  644. </td>
  645. <td class="description last"><p>The deadline for the entire call to
  646. complete.</p></td>
  647. </tr>
  648. <tr>
  649. <td class="name"><code>host</code></td>
  650. <td class="type">
  651. <span class="param-type">string</span>
  652. </td>
  653. <td class="description last"><p>Server hostname to set on the call. Only meaningful
  654. if different from the server address used to construct the client.</p></td>
  655. </tr>
  656. <tr>
  657. <td class="name"><code>parent</code></td>
  658. <td class="type">
  659. <span class="param-type"><a href="grpc.Client.html#~Call">grpc.Client~Call</a></span>
  660. </td>
  661. <td class="description last"><p>Parent call. Used in servers when
  662. making a call as part of the process of handling a call. Used to
  663. propagate some information automatically, as specified by
  664. propagate_flags.</p></td>
  665. </tr>
  666. <tr>
  667. <td class="name"><code>propagate_flags</code></td>
  668. <td class="type">
  669. <span class="param-type">number</span>
  670. </td>
  671. <td class="description last"><p>Indicates which properties of a parent
  672. call should propagate to this call. Bitwise combination of flags in
  673. <a href="grpc.html#.propagate">grpc.propagate</a>.</p></td>
  674. </tr>
  675. <tr>
  676. <td class="name"><code>credentials</code></td>
  677. <td class="type">
  678. <span class="param-type"><a href="grpc.credentials-CallCredentials.html">grpc.credentials~CallCredentials</a></span>
  679. </td>
  680. <td class="description last"><p>The credentials that
  681. should be used to make this particular call.</p></td>
  682. </tr>
  683. </tbody>
  684. </table>
  685. </dl>
  686. </dl>
  687. </dd>
  688. <hr>
  689. <dt>
  690. <h4 class="name" id="~requestCallback"><span class="type-signature"></span>requestCallback(error, value)</h4>
  691. </dt>
  692. <dd>
  693. <h5>Parameters:</h5>
  694. <table class="params table table-striped">
  695. <thead>
  696. <tr>
  697. <th>Name</th>
  698. <th>Type</th>
  699. <th>Argument</th>
  700. <th class="last">Description</th>
  701. </tr>
  702. </thead>
  703. <tbody>
  704. <tr>
  705. <td class="name"><code>error</code></td>
  706. <td class="type">
  707. <span class="param-type"><a href="grpc.html#~ServiceError">grpc~ServiceError</a></span>
  708. </td>
  709. <td class="attributes">
  710. &lt;nullable><br>
  711. </td>
  712. <td class="description last"><p>The error, if the call
  713. failed</p></td>
  714. </tr>
  715. <tr>
  716. <td class="name"><code>value</code></td>
  717. <td class="type">
  718. <span class="param-type">*</span>
  719. </td>
  720. <td class="attributes">
  721. </td>
  722. <td class="description last"><p>The response value, if the call succeeded</p></td>
  723. </tr>
  724. </tbody>
  725. </table>
  726. <dl class="details">
  727. </dl>
  728. </dd>
  729. </dl>
  730. </article>
  731. </section>
  732. </div>
  733. </div>
  734. <div class="clearfix"></div>
  735. <div class="col-md-3">
  736. <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
  737. </div>
  738. </div>
  739. </div>
  740. <div class="modal fade" id="searchResults">
  741. <div class="modal-dialog">
  742. <div class="modal-content">
  743. <div class="modal-header">
  744. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  745. <h4 class="modal-title">Search results</h4>
  746. </div>
  747. <div class="modal-body"></div>
  748. <div class="modal-footer">
  749. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  750. </div>
  751. </div><!-- /.modal-content -->
  752. </div><!-- /.modal-dialog -->
  753. </div>
  754. <footer>
  755. <span class="jsdoc-message">
  756. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
  757. on 2018-01-16T12:05:13-05:00
  758. using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
  759. </span>
  760. </footer>
  761. <script src="scripts/docstrap.lib.js"></script>
  762. <script src="scripts/toc.js"></script>
  763. <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
  764. <script>
  765. $( function () {
  766. $( "[id*='$']" ).each( function () {
  767. var $this = $( this );
  768. $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
  769. } );
  770. $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
  771. var $this = $( this );
  772. var example = $this.find( "code" );
  773. exampleText = example.html();
  774. var lang = /{@lang (.*?)}/.exec( exampleText );
  775. if ( lang && lang[1] ) {
  776. exampleText = exampleText.replace( lang[0], "" );
  777. example.html( exampleText );
  778. lang = lang[1];
  779. } else {
  780. var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
  781. lang = langClassMatch ? langClassMatch[1] : "javascript";
  782. }
  783. if ( lang ) {
  784. $this
  785. .addClass( "sunlight-highlight-" + lang )
  786. .addClass( "linenums" )
  787. .html( example.html() );
  788. }
  789. } );
  790. Sunlight.highlightAll( {
  791. lineNumbers : false,
  792. showMenu : true,
  793. enableDoclinks : true
  794. } );
  795. $.catchAnchorLinks( {
  796. navbarOffset: 10
  797. } );
  798. $( "#toc" ).toc( {
  799. anchorName : function ( i, heading, prefix ) {
  800. return $( heading ).attr( "id" ) || ( prefix + i );
  801. },
  802. selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
  803. showAndHide : false,
  804. smoothScrolling: true
  805. } );
  806. $( "#main span[id^='toc']" ).addClass( "toc-shim" );
  807. $( '.dropdown-toggle' ).dropdown();
  808. $( "table" ).each( function () {
  809. var $this = $( this );
  810. $this.addClass('table');
  811. } );
  812. } );
  813. </script>
  814. <!--Navigation and Symbol Display-->
  815. <!--Google Analytics-->
  816. <script type="text/javascript">
  817. $(document).ready(function() {
  818. SearcherDisplay.init();
  819. });
  820. </script>
  821. </body>
  822. </html>