grpc/node/grpc.Client.html

3425 lines
51 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Documentation Class: Client</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">Documentation</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="grpc.html">grpc</a></li><li><a href="grpc.credentials.html">grpc.credentials</a></li>
</ul>
</li>
<li class="dropdown">
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="module-src_client_interceptors.html">src/client_interceptors</a></li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<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>
</ul>
</li>
<li class="dropdown">
<a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
<ul class="dropdown-menu ">
<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>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<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>
</ul>
</li>
<li class="dropdown">
<a href="externals.list.html" class="dropdown-toggle" data-toggle="dropdown">Externals<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="external-Duplex.html">Duplex</a></li><li><a href="external-EventEmitter.html">EventEmitter</a></li><li><a href="external-GoogleCredential.html">GoogleCredential</a></li><li><a href="external-Readable.html">Readable</a></li><li><a href="external-Writable.html">Writable</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-8">
<div id="main">
<h1 class="page-title">Class: Client</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="grpc.html">grpc</a>.</span>
Client
</h2>
</header>
<article>
<div class="container-overview">
<hr>
<dt>
<h4 class="name" id="Client"><span class="type-signature"></span>new Client(address, credentials, options)</h4>
</dt>
<dd>
<div class="description">
<p>A generic gRPC client. Primarily useful as a base class for generated clients</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>address</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Server address to connect to</p></td>
</tr>
<tr>
<td class="name"><code>credentials</code></td>
<td class="type">
<span class="param-type"><a href="grpc.credentials-ChannelCredentials.html">grpc.credentials~ChannelCredentials</a></span>
</td>
<td class="description last"><p>Credentials to use
to connect to the server</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>Options to apply to channel creation. Any of
<a href="https://grpc.github.io/grpc/core/group__grpc__arg__keys.html">the channel arguments</a>
can be used here in addition to specific client options.</p>
<h6 class="method-params-label method-subparams-label">Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>interceptors</code></td>
<td class="type">
<span class="param-type">Array.&lt;grpc~Interceptor></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Interceptors to apply to each request</p></td>
</tr>
<tr>
<td class="name"><code>interceptor_providers</code></td>
<td class="type">
<span class="param-type">Array.&lt;grpc~InterceptorProvider></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Interceptor providers
to apply interceptors to each request depending on the method definition. At most
one of the interceptors and interceptor_providers options may be set.</p></td>
</tr>
<tr>
<td class="name"><code>callInvocationTransformer</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~callInvocationTransformer">grpc.Client~callInvocationTransformer</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>channelOverride</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Channel.html">grpc.Channel</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Channel to use instead of constructing a new one.
If set, the address, credentials, channel arguments options, and channelFactoryOverride
option will all be ignored.</p></td>
</tr>
<tr>
<td class="name"><code>channelFactoryOverride</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~channelFactory">grpc.Client~channelFactory</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Function to use instead of
the Channel constructor when creating the Client's channel.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<hr>
<dt>
<h4 class="name" id="close"><span class="type-signature"></span>close()</h4>
</dt>
<dd>
<div class="description">
<p>Close this client.</p>
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getChannel"><span class="type-signature"></span>getChannel()</h4>
</dt>
<dd>
<div class="description">
<p>Return the underlying channel object for the specified client</p>
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The channel</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Channel</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="makeBidiStreamRequest"><span class="type-signature"></span>makeBidiStreamRequest(path, serialize, deserialize [, metadata] [, options])</h4>
</dt>
<dd>
<div class="description">
<p>Make a bidirectional stream request with this method on the given channel.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The path of the method to request</p></td>
</tr>
<tr>
<td class="name"><code>serialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The serialization function for inputs</p></td>
</tr>
<tr>
<td class="name"><code>deserialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The deserialization
function for outputs</p></td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Array of metadata key/value
pairs to add to the call</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Options map</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An event emitter for stream related events</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="makeClientStreamRequest"><span class="type-signature"></span>makeClientStreamRequest(path, serialize, deserialize [, metadata] [, options], callback)</h4>
</dt>
<dd>
<div class="description">
<p>Make a client stream request to the given method, using the given serialize
and deserialize functions, with the given argument.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The path of the method to request</p></td>
</tr>
<tr>
<td class="name"><code>serialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The serialization function for
inputs</p></td>
</tr>
<tr>
<td class="name"><code>deserialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The deserialization
function for outputs</p></td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Array of metadata key/value pairs to add to
the call</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Options map</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The callback for when the
response is received</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An event emitter for stream related
events</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="makeServerStreamRequest"><span class="type-signature"></span>makeServerStreamRequest(path, serialize, deserialize, argument [, metadata] [, options])</h4>
</dt>
<dd>
<div class="description">
<p>Make a server stream request to the given method, with the given serialize
and deserialize function, using the given argument</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The path of the method to request</p></td>
</tr>
<tr>
<td class="name"><code>serialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The serialization function for inputs</p></td>
</tr>
<tr>
<td class="name"><code>deserialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The deserialization
function for outputs</p></td>
</tr>
<tr>
<td class="name"><code>argument</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The argument to the call. Should be serializable with
serialize</p></td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Array of metadata key/value pairs to add to
the call</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Options map</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An event emitter for stream related
events</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="makeUnaryRequest"><span class="type-signature"></span>makeUnaryRequest(path, serialize, deserialize, argument [, metadata] [, options], callback)</h4>
</dt>
<dd>
<div class="description">
<p>Make a unary request to the given method, using the given serialize
and deserialize functions, with the given argument.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The path of the method to request</p></td>
</tr>
<tr>
<td class="name"><code>serialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~serialize">grpc~serialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The serialization function for
inputs</p></td>
</tr>
<tr>
<td class="name"><code>deserialize</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~deserialize">grpc~deserialize</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The deserialization
function for outputs</p></td>
</tr>
<tr>
<td class="name"><code>argument</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The argument to the call. Should be serializable with
serialize</p></td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Metadata to add to the call</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Options map</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The callback
for when the response is received</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An event emitter for stream related events</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="waitForReady"><span class="type-signature"></span>waitForReady(deadline, callback)</h4>
</dt>
<dd>
<div class="description">
<p>Wait for the client to be ready. The callback will be called when the
client has successfully connected to the server, and it will be called
with an error if the attempt to connect to the server has unrecoverablly
failed or if the deadline expires. This function will make the channel
start connecting if it has not already done so.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>deadline</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~Deadline">grpc~Deadline</a></span>
</td>
<td class="description last"><p>When to stop waiting for a connection.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>The callback to call when done attempting
to connect.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="~callInvocationTransformer"><span class="type-signature">&lt;inner> </span>callInvocationTransformer(callProperties)</h4>
</dt>
<dd>
<div class="description">
<p>Call invocation transformer. Has access to the full call properties before a
call is processed and can modify most of those properties. Some modifications
will have no effect or may cause problems.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callProperties</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallProperties">grpc.Client~CallProperties</a></span>
</td>
<td class="description last"><p>The original call properties</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The modified call properties.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc.Client.html#~CallProperties">grpc.Client~CallProperties</a></span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="~channelFactory"><span class="type-signature">&lt;inner> </span>channelFactory(target, credentials, options)</h4>
</dt>
<dd>
<div class="description">
<p>A function that functionally replaces the Channel constructor.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>target</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The address of the server to connect to</p></td>
</tr>
<tr>
<td class="name"><code>credentials</code></td>
<td class="type">
<span class="param-type">grpc.ChannelCredentials</span>
</td>
<td class="description last"><p>Channel credentials to use when connecting</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~ChannelOptions">grpc~ChannelOptions</a></span>
</td>
<td class="description last"><p>A map of channel options that will be passed to the core.
The available options are listed in
<a href="https://grpc.github.io/grpc/core/group__grpc__arg__keys.html">this document</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>This can either be an actual channel object, or an object with the
same API.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="grpc.Channel.html">grpc.Channel</a></span>
</dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<hr>
<dt class="name" id="~Call">
<h4 id="~Call">Call</h4>
</dt>
<dd>
<div class="description">
<p>Any client call type</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></span>
|
<span class="param-type"><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></span>
|
<span class="param-type"><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></span>
|
<span class="param-type"><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></span>
</li>
</ul>
<dl class="details">
</dl>
</dd>
<hr>
<dt class="name" id="~CallOptions">
<h4 id="~CallOptions">CallOptions</h4>
</dt>
<dd>
<div class="description">
<p>Options that can be set on a call.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>deadline</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~Deadline">grpc~Deadline</a></span>
</td>
<td class="description last"><p>The deadline for the entire call to
complete.</p></td>
</tr>
<tr>
<td class="name"><code>host</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Server hostname to set on the call. Only meaningful
if different from the server address used to construct the client.</p></td>
</tr>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~Call">grpc.Client~Call</a></span>
</td>
<td class="description last"><p>Parent call. Used in servers when
making a call as part of the process of handling a call. Used to
propagate some information automatically, as specified by
propagate_flags.</p></td>
</tr>
<tr>
<td class="name"><code>propagate_flags</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Indicates which properties of a parent
call should propagate to this call. Bitwise combination of flags in
<a href="grpc.html#.propagate">grpc.propagate</a>.</p></td>
</tr>
<tr>
<td class="name"><code>credentials</code></td>
<td class="type">
<span class="param-type"><a href="grpc.credentials-CallCredentials.html">grpc.credentials~CallCredentials</a></span>
</td>
<td class="description last"><p>The credentials that
should be used to make this particular call.</p></td>
</tr>
</tbody>
</table>
</dl>
</dl>
</dd>
<hr>
<dt class="name" id="~CallProperties">
<h4 id="~CallProperties">CallProperties</h4>
</dt>
<dd>
<div class="description">
<p>Properties of a call, for use with a <a href="grpc.Client.html#~callInvocationTransformer">grpc.Client~callInvocationTransformer</a>.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>argument</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>The call argument. Only preset if the method is unary or server streaming.</p></td>
</tr>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Metadata.html">grpc.Metadata</a></span>
</td>
<td class="description last"><p>The request metadata</p></td>
</tr>
<tr>
<td class="name"><code>call</code></td>
<td class="type">
<span class="param-type"><a href="grpc-Call.html">grpc~Call</a></span>
</td>
<td class="description last"><p>The call object that will be returned by the client method</p></td>
</tr>
<tr>
<td class="name"><code>channel</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Channel.html">grpc.Channel</a></span>
</td>
<td class="description last"><p>The channel that will be used to make a request</p></td>
</tr>
<tr>
<td class="name"><code>methodDefinition</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~MethodDefinition">grpc~MethodDefinition</a></span>
</td>
<td class="description last"><p>The MethodDefinition object that describes this method</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~CallOptions">grpc.Client~CallOptions</a></span>
</td>
<td class="description last"><p>The call options passed when making this request</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="grpc.Client.html#~requestCallback">grpc.Client~requestCallback</a></span>
</td>
<td class="description last"><p>The callback that will handle the response.
Only present if this method is unary or client streaming.</p></td>
</tr>
</tbody>
</table>
</dl>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="~requestCallback"><span class="type-signature"></span>requestCallback(error, value)</h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="grpc.html#~ServiceError">grpc~ServiceError</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>The error, if the call
failed</p></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The response value, if the call succeeded</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
</div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
on 2019-07-15T16:38:16-07:00
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : false,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>