mirror of https://github.com/grpc/grpc-node.git
Retrieve callInvocationTransformer from constructor options.
This commit is contained in:
parent
cd6e2062c8
commit
8320743f6d
|
@ -383,12 +383,16 @@ function Client(address, credentials, options) {
|
||||||
.resolveInterceptorProviders(self.$interceptor_providers, method_definition)
|
.resolveInterceptorProviders(self.$interceptor_providers, method_definition)
|
||||||
.concat(self.$interceptors);
|
.concat(self.$interceptors);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.$callInvocationTransformer = options.callInvocationTransformer;
|
||||||
|
|
||||||
let channelOverride = options.channelOverride;
|
let channelOverride = options.channelOverride;
|
||||||
let channelFactoryOverride = options.channelFactoryOverride;
|
let channelFactoryOverride = options.channelFactoryOverride;
|
||||||
// Exclude channel options which have already been consumed
|
// Exclude channel options which have already been consumed
|
||||||
var channel_options = _.omit(options,
|
var channel_options = _.omit(options,
|
||||||
['interceptors', 'interceptor_providers',
|
['interceptors', 'interceptor_providers',
|
||||||
'channelOverride', 'channelFactoryOverride']);
|
'channelOverride', 'channelFactoryOverride',
|
||||||
|
'callInvocationTransformer']);
|
||||||
/* Private fields use $ as a prefix instead of _ because it is an invalid
|
/* Private fields use $ as a prefix instead of _ because it is an invalid
|
||||||
* prefix of a method name */
|
* prefix of a method name */
|
||||||
if (channelOverride) {
|
if (channelOverride) {
|
||||||
|
@ -491,9 +495,8 @@ Client.prototype.makeUnaryRequest = function(path, serialize, deserialize,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transform call properties if specified.
|
// Transform call properties if specified.
|
||||||
var callInvocationTransformer = options.callInvocationTransformer;
|
if (this.$callInvocationTransformer) {
|
||||||
if (callInvocationTransformer) {
|
callProperties = this.$callInvocationTransformer(callProperties);
|
||||||
callProperties = callInvocationTransformer(callProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var callOptions = callProperties.callOptions;
|
var callOptions = callProperties.callOptions;
|
||||||
|
@ -594,9 +597,8 @@ Client.prototype.makeClientStreamRequest = function(path, serialize,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transform call properties if specified.
|
// Transform call properties if specified.
|
||||||
var callInvocationTransformer = options.callInvocationTransformer;
|
if (this.$callInvocationTransformer) {
|
||||||
if (callInvocationTransformer) {
|
callProperties = this.$callInvocationTransformer(callProperties);
|
||||||
callProperties = callInvocationTransformer(callProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var callOptions = callProperties.callOptions;
|
var callOptions = callProperties.callOptions;
|
||||||
|
@ -680,9 +682,8 @@ Client.prototype.makeServerStreamRequest = function(path, serialize,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transform call properties if specified.
|
// Transform call properties if specified.
|
||||||
var callInvocationTransformer = options.callInvocationTransformer;
|
if (this.$callInvocationTransformer) {
|
||||||
if (callInvocationTransformer) {
|
callProperties = this.$callInvocationTransformer(callProperties);
|
||||||
callProperties = callInvocationTransformer(callProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var callOptions = callProperties.callOptions;
|
var callOptions = callProperties.callOptions;
|
||||||
|
@ -760,9 +761,8 @@ Client.prototype.makeBidiStreamRequest = function(path, serialize,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Transform call properties if specified.
|
// Transform call properties if specified.
|
||||||
var callInvocationTransformer = options.callInvocationTransformer;
|
if (this.$callInvocationTransformer) {
|
||||||
if (callInvocationTransformer) {
|
callProperties = this.$callInvocationTransformer(callProperties);
|
||||||
callProperties = callInvocationTransformer(callProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var callOptions = callProperties.callOptions;
|
var callOptions = callProperties.callOptions;
|
||||||
|
|
Loading…
Reference in New Issue