grpc.Server.html 32 KB

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