This commit is contained in:
Michael Lumish 2020-04-27 11:56:49 -07:00
parent 424c9bfe70
commit a2839e7b2d
9 changed files with 20 additions and 15 deletions

View File

@ -411,7 +411,10 @@ export class Http2CallStream implements Call {
extraFilterFactory?: FilterFactory<Filter>
): void {
if (extraFilterFactory !== undefined) {
this.filterStack = new FilterStack([this.filterStack, extraFilterFactory.createFilter(this)]);
this.filterStack = new FilterStack([
this.filterStack,
extraFilterFactory.createFilter(this),
]);
}
if (this.finalStatus !== null) {
stream.close(NGHTTP2_CANCEL);

View File

@ -174,7 +174,9 @@ export class ChannelImplementation implements Channel {
* resolver */
const defaultSchemeMapResult = mapUriDefaultScheme(originalTargetUri);
if (defaultSchemeMapResult === null) {
throw new Error(`Could not find a default scheme for target name "${target}"`);
throw new Error(
`Could not find a default scheme for target name "${target}"`
);
}
if (this.options['grpc.default_authority']) {
this.defaultAuthority = this.options['grpc.default_authority'] as string;

View File

@ -66,7 +66,7 @@ class PickFirstPicker implements Picker {
subchannel: this.subchannel,
status: null,
extraFilterFactory: null,
onCallStarted: null
onCallStarted: null,
};
}
}

View File

@ -68,7 +68,7 @@ export interface LoadBalancer {
updateAddressList(
addressList: SubchannelAddress[],
lbConfig: LoadBalancingConfig | null,
attributes: {[key: string]: unknown}
attributes: { [key: string]: unknown }
): void;
/**
* If the load balancer is currently in the IDLE state, start connecting.

View File

@ -110,7 +110,7 @@ export class UnavailablePicker implements Picker {
subchannel: null,
status: this.status,
extraFilterFactory: null,
onCallStarted: null
onCallStarted: null,
};
}
}
@ -139,7 +139,7 @@ export class QueuePicker {
subchannel: null,
status: null,
extraFilterFactory: null,
onCallStarted: null
onCallStarted: null,
};
}
}

View File

@ -14,11 +14,7 @@
* limitations under the License.
*/
import {
Resolver,
ResolverListener,
registerResolver,
} from './resolver';
import { Resolver, ResolverListener, registerResolver } from './resolver';
import { SubchannelAddress } from './subchannel';
import { GrpcUri } from './uri-parser';

View File

@ -40,7 +40,7 @@ export interface ResolverListener {
addressList: SubchannelAddress[],
serviceConfig: ServiceConfig | null,
serviceConfigError: StatusObject | null,
attributes: {[key: string]: unknown}
attributes: { [key: string]: unknown }
): void;
/**
* Called whenever a name resolution attempt fails.
@ -138,7 +138,7 @@ export function mapUriDefaultScheme(target: GrpcUri): GrpcUri | null {
return {
scheme: defaultScheme,
authority: undefined,
path: uriToString(target)
path: uriToString(target),
};
} else {
return null;

View File

@ -137,7 +137,7 @@ export class ResolvingLoadBalancer implements LoadBalancer {
addressList: SubchannelAddress[],
serviceConfig: ServiceConfig | null,
serviceConfigError: ServiceError | null,
attributes: {[key: string]: unknown}
attributes: { [key: string]: unknown }
) => {
let workingServiceConfig: ServiceConfig | null = null;
/* This first group of conditionals implements the algorithm described

View File

@ -620,7 +620,11 @@ export class Subchannel {
* @param metadata
* @param callStream
*/
startCallStream(metadata: Metadata, callStream: Http2CallStream, extraFilterFactory?: FilterFactory<Filter>) {
startCallStream(
metadata: Metadata,
callStream: Http2CallStream,
extraFilterFactory?: FilterFactory<Filter>
) {
const headers = metadata.toHttp2Headers();
headers[HTTP2_HEADER_AUTHORITY] = callStream.getHost();
headers[HTTP2_HEADER_USER_AGENT] = this.userAgent;