grpc.Server.html 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225
  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: Server</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: Server</h1>
  69. <section>
  70. <header>
  71. <h2>
  72. <span class="ancestors"><a href="grpc.html">grpc</a>.</span>
  73. Server
  74. </h2>
  75. </header>
  76. <article>
  77. <div class="container-overview">
  78. <hr>
  79. <dt>
  80. <h4 class="name" id="Server"><span class="type-signature"></span>new Server( [options])</h4>
  81. </dt>
  82. <dd>
  83. <div class="description">
  84. <p>Constructs a server object that stores request handlers and delegates
  85. incoming requests to those handlers</p>
  86. </div>
  87. <h5>Parameters:</h5>
  88. <table class="params table table-striped">
  89. <thead>
  90. <tr>
  91. <th>Name</th>
  92. <th>Type</th>
  93. <th>Argument</th>
  94. <th class="last">Description</th>
  95. </tr>
  96. </thead>
  97. <tbody>
  98. <tr>
  99. <td class="name"><code>options</code></td>
  100. <td class="type">
  101. <span class="param-type">Object</span>
  102. </td>
  103. <td class="attributes">
  104. &lt;optional><br>
  105. </td>
  106. <td class="description last"><p>Options that should be passed to the internal server
  107. implementation</p></td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <dl class="details">
  112. </dl>
  113. <h5>Example</h5>
  114. <pre class="sunlight-highlight-javascript">var server = new grpc.Server();
  115. server.addProtoService(protobuf_service_descriptor, service_implementation);
  116. server.bind(&#x27;address:port&#x27;, server_credential);
  117. server.start();</pre>
  118. </dd>
  119. </div>
  120. <h3 class="subsection-title">Members</h3>
  121. <dl>
  122. <hr>
  123. <dt class="name" id="addProtoService">
  124. <h4 id="addProtoService"><span class="type-signature"></span>addProtoService<span class="type-signature"></span></h4>
  125. </dt>
  126. <dd>
  127. <div class="description">
  128. <p>Add a proto service to the server, with a corresponding implementation</p>
  129. </div>
  130. <dl class="details">
  131. <dt class="important tag-deprecated method-doc-label method-doc-details-label">Deprecated:</dt>
  132. <dd>
  133. <ul class="dummy">
  134. <li>Use <a href="grpc.Server.html#addService">grpc.Server#addService</a> instead</li>
  135. </ul>
  136. </dd>
  137. </dl>
  138. </dd>
  139. </dl>
  140. <h3 class="subsection-title">Methods</h3>
  141. <dl>
  142. <hr>
  143. <dt>
  144. <h4 class="name" id="addService"><span class="type-signature"></span>addService(service, implementation)</h4>
  145. </dt>
  146. <dd>
  147. <div class="description">
  148. <p>Add a service to the server, with a corresponding implementation.</p>
  149. </div>
  150. <h5>Parameters:</h5>
  151. <table class="params table table-striped">
  152. <thead>
  153. <tr>
  154. <th>Name</th>
  155. <th>Type</th>
  156. <th class="last">Description</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <tr>
  161. <td class="name"><code>service</code></td>
  162. <td class="type">
  163. <span class="param-type"><a href="grpc.html#~ServiceDefinition">grpc~ServiceDefinition</a></span>
  164. </td>
  165. <td class="description last"><p>The service descriptor</p></td>
  166. </tr>
  167. <tr>
  168. <td class="name"><code>implementation</code></td>
  169. <td class="type">
  170. <span class="param-type">Object.&lt;String, <a href="grpc.Server.html#~handleCall">grpc.Server~handleCall</a>></span>
  171. </td>
  172. <td class="description last"><p>Map of method
  173. names to method implementation for the provided service.</p></td>
  174. </tr>
  175. </tbody>
  176. </table>
  177. <dl class="details">
  178. </dl>
  179. </dd>
  180. <hr>
  181. <dt>
  182. <h4 class="name" id="bind"><span class="type-signature"></span>bind(port, creds)</h4>
  183. </dt>
  184. <dd>
  185. <div class="description">
  186. <p>Binds the server to the given port, with SSL disabled if creds is an
  187. insecure credentials object</p>
  188. </div>
  189. <h5>Parameters:</h5>
  190. <table class="params table table-striped">
  191. <thead>
  192. <tr>
  193. <th>Name</th>
  194. <th>Type</th>
  195. <th class="last">Description</th>
  196. </tr>
  197. </thead>
  198. <tbody>
  199. <tr>
  200. <td class="name"><code>port</code></td>
  201. <td class="type">
  202. <span class="param-type">string</span>
  203. </td>
  204. <td class="description last"><p>The port that the server should bind on, in the format
  205. &quot;address:port&quot;</p></td>
  206. </tr>
  207. <tr>
  208. <td class="name"><code>creds</code></td>
  209. <td class="type">
  210. <span class="param-type"><a href="grpc.ServerCredentials.html">grpc.ServerCredentials</a></span>
  211. </td>
  212. <td class="description last"><p>Server credential object to be used for
  213. SSL. Pass an insecure credentials object for an insecure port.</p></td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <dl class="details">
  218. </dl>
  219. </dd>
  220. <hr>
  221. <dt>
  222. <h4 class="name" id="forceShutdown"><span class="type-signature"></span>forceShutdown()</h4>
  223. </dt>
  224. <dd>
  225. <div class="description">
  226. <p>Forcibly shuts down the server. The server will stop receiving new calls
  227. and cancel all pending calls. When it returns, the server has shut down.
  228. This method is idempotent with itself and tryShutdown, and it will trigger
  229. any outstanding tryShutdown callbacks.</p>
  230. </div>
  231. <dl class="details">
  232. </dl>
  233. </dd>
  234. <hr>
  235. <dt>
  236. <h4 class="name" id="register"><span class="type-signature"></span>register(name, handler, serialize, deserialize, type)</h4>
  237. </dt>
  238. <dd>
  239. <div class="description">
  240. <p>Registers a handler to handle the named method. Fails if there already is
  241. a handler for the given method. Returns true on success</p>
  242. </div>
  243. <h5>Parameters:</h5>
  244. <table class="params table table-striped">
  245. <thead>
  246. <tr>
  247. <th>Name</th>
  248. <th>Type</th>
  249. <th class="last">Description</th>
  250. </tr>
  251. </thead>
  252. <tbody>
  253. <tr>
  254. <td class="name"><code>name</code></td>
  255. <td class="type">
  256. <span class="param-type">string</span>
  257. </td>
  258. <td class="description last"><p>The name of the method that the provided function should
  259. handle/respond to.</p></td>
  260. </tr>
  261. <tr>
  262. <td class="name"><code>handler</code></td>
  263. <td class="type">
  264. <span class="param-type"><a href="grpc.Server.html#~handleCall">grpc.Server~handleCall</a></span>
  265. </td>
  266. <td class="description last"><p>Function that takes a stream of
  267. request values and returns a stream of response values</p></td>
  268. </tr>
  269. <tr>
  270. <td class="name"><code>serialize</code></td>
  271. <td class="type">
  272. <span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
  273. </td>
  274. <td class="description last"><p>Serialization function for responses</p></td>
  275. </tr>
  276. <tr>
  277. <td class="name"><code>deserialize</code></td>
  278. <td class="type">
  279. <span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
  280. </td>
  281. <td class="description last"><p>Deserialization function for requests</p></td>
  282. </tr>
  283. <tr>
  284. <td class="name"><code>type</code></td>
  285. <td class="type">
  286. <span class="param-type">string</span>
  287. </td>
  288. <td class="description last"><p>The streaming type of method that this handles</p></td>
  289. </tr>
  290. </tbody>
  291. </table>
  292. <dl class="details">
  293. </dl>
  294. <h5>Returns:</h5>
  295. <div class="param-desc">
  296. <p>True if the handler was set. False if a handler was already
  297. set for that name.</p>
  298. </div>
  299. <dl>
  300. <dt>
  301. Type
  302. </dt>
  303. <dd>
  304. <span class="param-type">boolean</span>
  305. </dd>
  306. </dl>
  307. </dd>
  308. <hr>
  309. <dt>
  310. <h4 class="name" id="start"><span class="type-signature"></span>start()</h4>
  311. </dt>
  312. <dd>
  313. <div class="description">
  314. <p>Start the server and begin handling requests</p>
  315. </div>
  316. <dl class="details">
  317. </dl>
  318. </dd>
  319. <hr>
  320. <dt>
  321. <h4 class="name" id="tryShutdown"><span class="type-signature"></span>tryShutdown(callback)</h4>
  322. </dt>
  323. <dd>
  324. <div class="description">
  325. <p>Gracefully shuts down the server. The server will stop receiving new calls,
  326. and any pending calls will complete. The callback will be called when all
  327. pending calls have completed and the server is fully shut down. This method
  328. is idempotent with itself and forceShutdown.</p>
  329. </div>
  330. <h5>Parameters:</h5>
  331. <table class="params table table-striped">
  332. <thead>
  333. <tr>
  334. <th>Name</th>
  335. <th>Type</th>
  336. <th class="last">Description</th>
  337. </tr>
  338. </thead>
  339. <tbody>
  340. <tr>
  341. <td class="name"><code>callback</code></td>
  342. <td class="type">
  343. <span class="param-type">function</span>
  344. </td>
  345. <td class="description last"><p>The shutdown complete callback</p></td>
  346. </tr>
  347. </tbody>
  348. </table>
  349. <dl class="details">
  350. </dl>
  351. </dd>
  352. </dl>
  353. <h3 class="subsection-title">Type Definitions</h3>
  354. <dl>
  355. <hr>
  356. <dt>
  357. <h4 class="name" id="~handleBidiStreamingCall"><span class="type-signature"></span>handleBidiStreamingCall(call)</h4>
  358. </dt>
  359. <dd>
  360. <div class="description">
  361. <p>User provided method to handle bidirectional streaming calls on the server.</p>
  362. </div>
  363. <h5>Parameters:</h5>
  364. <table class="params table table-striped">
  365. <thead>
  366. <tr>
  367. <th>Name</th>
  368. <th>Type</th>
  369. <th class="last">Description</th>
  370. </tr>
  371. </thead>
  372. <tbody>
  373. <tr>
  374. <td class="name"><code>call</code></td>
  375. <td class="type">
  376. <span class="param-type"><a href="grpc-ServerDuplexStream.html">grpc~ServerDuplexStream</a></span>
  377. </td>
  378. <td class="description last"><p>The call object</p></td>
  379. </tr>
  380. </tbody>
  381. </table>
  382. <dl class="details">
  383. </dl>
  384. </dd>
  385. <hr>
  386. <dt class="name" id="~handleCall">
  387. <h4 id="~handleCall">handleCall</h4>
  388. </dt>
  389. <dd>
  390. <div class="description">
  391. <p>Unified type for application handlers for all types of calls</p>
  392. </div>
  393. <h5>Type:</h5>
  394. <ul>
  395. <li>
  396. <span class="param-type"><a href="grpc.Server.html#~handleUnaryCall">grpc.Server~handleUnaryCall</a></span>
  397. |
  398. <span class="param-type"><a href="grpc.Server.html#~handleClientStreamingCall">grpc.Server~handleClientStreamingCall</a></span>
  399. |
  400. <span class="param-type"><a href="grpc.Server.html#~handleServerStreamingCall">grpc.Server~handleServerStreamingCall</a></span>
  401. |
  402. <span class="param-type"><a href="grpc.Server.html#~handleBidiStreamingCall">grpc.Server~handleBidiStreamingCall</a></span>
  403. </li>
  404. </ul>
  405. <dl class="details">
  406. </dl>
  407. </dd>
  408. <hr>
  409. <dt>
  410. <h4 class="name" id="~handleClientStreamingCall"><span class="type-signature"></span>handleClientStreamingCall(call, callback)</h4>
  411. </dt>
  412. <dd>
  413. <div class="description">
  414. <p>User provided method to handle client streaming methods on the server.</p>
  415. </div>
  416. <h5>Parameters:</h5>
  417. <table class="params table table-striped">
  418. <thead>
  419. <tr>
  420. <th>Name</th>
  421. <th>Type</th>
  422. <th class="last">Description</th>
  423. </tr>
  424. </thead>
  425. <tbody>
  426. <tr>
  427. <td class="name"><code>call</code></td>
  428. <td class="type">
  429. <span class="param-type"><a href="grpc-ServerReadableStream.html">grpc~ServerReadableStream</a></span>
  430. </td>
  431. <td class="description last"><p>The call object</p></td>
  432. </tr>
  433. <tr>
  434. <td class="name"><code>callback</code></td>
  435. <td class="type">
  436. <span class="param-type"><a href="grpc.Server.html#~sendUnaryData">grpc.Server~sendUnaryData</a></span>
  437. </td>
  438. <td class="description last"><p>The callback to call to respond
  439. to the request</p></td>
  440. </tr>
  441. </tbody>
  442. </table>
  443. <dl class="details">
  444. </dl>
  445. </dd>
  446. <hr>
  447. <dt>
  448. <h4 class="name" id="~handleServerStreamingCall"><span class="type-signature"></span>handleServerStreamingCall(call)</h4>
  449. </dt>
  450. <dd>
  451. <div class="description">
  452. <p>User provided method to handle server streaming methods on the server.</p>
  453. </div>
  454. <h5>Parameters:</h5>
  455. <table class="params table table-striped">
  456. <thead>
  457. <tr>
  458. <th>Name</th>
  459. <th>Type</th>
  460. <th class="last">Description</th>
  461. </tr>
  462. </thead>
  463. <tbody>
  464. <tr>
  465. <td class="name"><code>call</code></td>
  466. <td class="type">
  467. <span class="param-type"><a href="grpc-ServerWritableStream.html">grpc~ServerWritableStream</a></span>
  468. </td>
  469. <td class="description last"><p>The call object</p></td>
  470. </tr>
  471. </tbody>
  472. </table>
  473. <dl class="details">
  474. </dl>
  475. </dd>
  476. <hr>
  477. <dt>
  478. <h4 class="name" id="~handleUnaryCall"><span class="type-signature"></span>handleUnaryCall(call, callback)</h4>
  479. </dt>
  480. <dd>
  481. <div class="description">
  482. <p>User-provided method to handle unary requests on a server</p>
  483. </div>
  484. <h5>Parameters:</h5>
  485. <table class="params table table-striped">
  486. <thead>
  487. <tr>
  488. <th>Name</th>
  489. <th>Type</th>
  490. <th class="last">Description</th>
  491. </tr>
  492. </thead>
  493. <tbody>
  494. <tr>
  495. <td class="name"><code>call</code></td>
  496. <td class="type">
  497. <span class="param-type"><a href="grpc-ServerUnaryCall.html">grpc~ServerUnaryCall</a></span>
  498. </td>
  499. <td class="description last"><p>The call object</p></td>
  500. </tr>
  501. <tr>
  502. <td class="name"><code>callback</code></td>
  503. <td class="type">
  504. <span class="param-type"><a href="grpc.Server.html#~sendUnaryData">grpc.Server~sendUnaryData</a></span>
  505. </td>
  506. <td class="description last"><p>The callback to call to respond
  507. to the request</p></td>
  508. </tr>
  509. </tbody>
  510. </table>
  511. <dl class="details">
  512. </dl>
  513. </dd>
  514. <hr>
  515. <dt>
  516. <h4 class="name" id="~sendUnaryData"><span class="type-signature"></span>sendUnaryData(error, value [, trailer] [, flags])</h4>
  517. </dt>
  518. <dd>
  519. <div class="description">
  520. <p>Callback function passed to server handlers that handle methods with unary
  521. responses.</p>
  522. </div>
  523. <h5>Parameters:</h5>
  524. <table class="params table table-striped">
  525. <thead>
  526. <tr>
  527. <th>Name</th>
  528. <th>Type</th>
  529. <th>Argument</th>
  530. <th class="last">Description</th>
  531. </tr>
  532. </thead>
  533. <tbody>
  534. <tr>
  535. <td class="name"><code>error</code></td>
  536. <td class="type">
  537. <span class="param-type"><a href="grpc.html#~ServiceError">grpc~ServiceError</a></span>
  538. </td>
  539. <td class="attributes">
  540. </td>
  541. <td class="description last"><p>An error, if the call failed</p></td>
  542. </tr>
  543. <tr>
  544. <td class="name"><code>value</code></td>
  545. <td class="type">
  546. <span class="param-type">*</span>
  547. </td>
  548. <td class="attributes">
  549. </td>
  550. <td class="description last"><p>The response value. Must be a valid argument to the
  551. <code>responseSerialize</code> method of the method that is being handled</p></td>
  552. </tr>
  553. <tr>
  554. <td class="name"><code>trailer</code></td>
  555. <td class="type">
  556. <span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
  557. </td>
  558. <td class="attributes">
  559. &lt;optional><br>
  560. </td>
  561. <td class="description last"><p>Trailing metadata to send, if applicable</p></td>
  562. </tr>
  563. <tr>
  564. <td class="name"><code>flags</code></td>
  565. <td class="type">
  566. <span class="param-type"><a href="grpc.html#.writeFlags">grpc.writeFlags</a></span>
  567. </td>
  568. <td class="attributes">
  569. &lt;optional><br>
  570. </td>
  571. <td class="description last"><p>Flags to modify writing the response</p></td>
  572. </tr>
  573. </tbody>
  574. </table>
  575. <dl class="details">
  576. </dl>
  577. </dd>
  578. </dl>
  579. </article>
  580. </section>
  581. </div>
  582. </div>
  583. <div class="clearfix"></div>
  584. <div class="col-md-3">
  585. <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
  586. </div>
  587. </div>
  588. </div>
  589. <div class="modal fade" id="searchResults">
  590. <div class="modal-dialog">
  591. <div class="modal-content">
  592. <div class="modal-header">
  593. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  594. <h4 class="modal-title">Search results</h4>
  595. </div>
  596. <div class="modal-body"></div>
  597. <div class="modal-footer">
  598. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  599. </div>
  600. </div><!-- /.modal-content -->
  601. </div><!-- /.modal-dialog -->
  602. </div>
  603. <footer>
  604. <span class="jsdoc-message">
  605. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
  606. on 2018-01-16T12:05:13-05:00
  607. using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
  608. </span>
  609. </footer>
  610. <script src="scripts/docstrap.lib.js"></script>
  611. <script src="scripts/toc.js"></script>
  612. <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
  613. <script>
  614. $( function () {
  615. $( "[id*='$']" ).each( function () {
  616. var $this = $( this );
  617. $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
  618. } );
  619. $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
  620. var $this = $( this );
  621. var example = $this.find( "code" );
  622. exampleText = example.html();
  623. var lang = /{@lang (.*?)}/.exec( exampleText );
  624. if ( lang && lang[1] ) {
  625. exampleText = exampleText.replace( lang[0], "" );
  626. example.html( exampleText );
  627. lang = lang[1];
  628. } else {
  629. var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
  630. lang = langClassMatch ? langClassMatch[1] : "javascript";
  631. }
  632. if ( lang ) {
  633. $this
  634. .addClass( "sunlight-highlight-" + lang )
  635. .addClass( "linenums" )
  636. .html( example.html() );
  637. }
  638. } );
  639. Sunlight.highlightAll( {
  640. lineNumbers : false,
  641. showMenu : true,
  642. enableDoclinks : true
  643. } );
  644. $.catchAnchorLinks( {
  645. navbarOffset: 10
  646. } );
  647. $( "#toc" ).toc( {
  648. anchorName : function ( i, heading, prefix ) {
  649. return $( heading ).attr( "id" ) || ( prefix + i );
  650. },
  651. selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
  652. showAndHide : false,
  653. smoothScrolling: true
  654. } );
  655. $( "#main span[id^='toc']" ).addClass( "toc-shim" );
  656. $( '.dropdown-toggle' ).dropdown();
  657. $( "table" ).each( function () {
  658. var $this = $( this );
  659. $this.addClass('table');
  660. } );
  661. } );
  662. </script>
  663. <!--Navigation and Symbol Display-->
  664. <!--Google Analytics-->
  665. <script type="text/javascript">
  666. $(document).ready(function() {
  667. SearcherDisplay.init();
  668. });
  669. </script>
  670. </body>
  671. </html>