@grpc/grpc-js
Advanced tools
Comparing version 1.8.11 to 1.8.12
@@ -329,3 +329,4 @@ "use strict"; | ||
if (this.subchannels.length === 0 || | ||
!this.latestAddressList.every((value, index) => (0, subchannel_address_1.subchannelAddressEqual)(addressList[index], value))) { | ||
this.latestAddressList.length !== addressList.length || | ||
!this.latestAddressList.every((value, index) => addressList[index] && (0, subchannel_address_1.subchannelAddressEqual)(addressList[index], value))) { | ||
this.latestAddressList = addressList; | ||
@@ -332,0 +333,0 @@ this.connectToAddressList(); |
@@ -83,2 +83,3 @@ "use strict"; | ||
} | ||
this.trace('Pick called'); | ||
const pickResult = this.channel.doPick(this.metadata, this.callConfig.pickInformation); | ||
@@ -85,0 +86,0 @@ const subchannelString = pickResult.subchannel ? |
@@ -526,6 +526,6 @@ "use strict"; | ||
let pushedEnd = false; | ||
const maybePushEnd = () => { | ||
const maybePushEnd = async () => { | ||
if (!pushedEnd && readsDone && !pendingMessageProcessing) { | ||
pushedEnd = true; | ||
this.pushOrBufferMessage(readable, null); | ||
await this.pushOrBufferMessage(readable, null); | ||
} | ||
@@ -554,11 +554,11 @@ }; | ||
return; | ||
this.pushOrBufferMessage(readable, decompressedMessage); | ||
await this.pushOrBufferMessage(readable, decompressedMessage); | ||
} | ||
pendingMessageProcessing = false; | ||
this.stream.resume(); | ||
maybePushEnd(); | ||
await maybePushEnd(); | ||
}); | ||
this.stream.once('end', () => { | ||
this.stream.once('end', async () => { | ||
readsDone = true; | ||
maybePushEnd(); | ||
await maybePushEnd(); | ||
}); | ||
@@ -578,3 +578,3 @@ } | ||
} | ||
pushOrBufferMessage(readable, messageBytes) { | ||
async pushOrBufferMessage(readable, messageBytes) { | ||
if (this.isPushPending) { | ||
@@ -584,3 +584,3 @@ this.bufferedMessages.push(messageBytes); | ||
else { | ||
this.pushMessage(readable, messageBytes); | ||
await this.pushMessage(readable, messageBytes); | ||
} | ||
@@ -627,3 +627,3 @@ } | ||
if (this.bufferedMessages.length > 0) { | ||
this.pushMessage(readable, this.bufferedMessages.shift()); | ||
await this.pushMessage(readable, this.bufferedMessages.shift()); | ||
} | ||
@@ -630,0 +630,0 @@ } |
@@ -16,4 +16,4 @@ export interface TcpSubchannelAddress { | ||
export declare function isTcpSubchannelAddress(address: SubchannelAddress): address is TcpSubchannelAddress; | ||
export declare function subchannelAddressEqual(address1: SubchannelAddress, address2: SubchannelAddress): boolean; | ||
export declare function subchannelAddressEqual(address1?: SubchannelAddress, address2?: SubchannelAddress): boolean; | ||
export declare function subchannelAddressToString(address: SubchannelAddress): string; | ||
export declare function stringToSubchannelAddress(addressString: string, port?: number): SubchannelAddress; |
@@ -26,2 +26,8 @@ "use strict"; | ||
function subchannelAddressEqual(address1, address2) { | ||
if (!address1 && !address2) { | ||
return true; | ||
} | ||
if (!address1 || !address2) { | ||
return false; | ||
} | ||
if (isTcpSubchannelAddress(address1)) { | ||
@@ -28,0 +34,0 @@ return (isTcpSubchannelAddress(address2) && |
{ | ||
"name": "@grpc/grpc-js", | ||
"version": "1.8.11", | ||
"version": "1.8.12", | ||
"description": "gRPC Library for Node - pure JS implementation", | ||
@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/", |
@@ -423,4 +423,5 @@ /* | ||
this.subchannels.length === 0 || | ||
this.latestAddressList.length !== addressList.length || | ||
!this.latestAddressList.every( | ||
(value, index) => subchannelAddressEqual(addressList[index], value) | ||
(value, index) => addressList[index] && subchannelAddressEqual(addressList[index], value) | ||
) | ||
@@ -427,0 +428,0 @@ ) { |
@@ -105,2 +105,3 @@ /* | ||
} | ||
this.trace('Pick called') | ||
const pickResult = this.channel.doPick(this.metadata, this.callConfig.pickInformation); | ||
@@ -107,0 +108,0 @@ const subchannelString = pickResult.subchannel ? |
@@ -815,6 +815,6 @@ /* | ||
const maybePushEnd = () => { | ||
const maybePushEnd = async () => { | ||
if (!pushedEnd && readsDone && !pendingMessageProcessing) { | ||
pushedEnd = true; | ||
this.pushOrBufferMessage(readable, null); | ||
await this.pushOrBufferMessage(readable, null); | ||
} | ||
@@ -852,12 +852,12 @@ }; | ||
this.pushOrBufferMessage(readable, decompressedMessage); | ||
await this.pushOrBufferMessage(readable, decompressedMessage); | ||
} | ||
pendingMessageProcessing = false; | ||
this.stream.resume(); | ||
maybePushEnd(); | ||
await maybePushEnd(); | ||
}); | ||
this.stream.once('end', () => { | ||
this.stream.once('end', async () => { | ||
readsDone = true; | ||
maybePushEnd(); | ||
await maybePushEnd(); | ||
}); | ||
@@ -886,3 +886,3 @@ } | ||
private pushOrBufferMessage( | ||
private async pushOrBufferMessage( | ||
readable: | ||
@@ -892,7 +892,7 @@ | ServerReadableStream<RequestType, ResponseType> | ||
messageBytes: Buffer | null | ||
): void { | ||
): Promise<void> { | ||
if (this.isPushPending) { | ||
this.bufferedMessages.push(messageBytes); | ||
} else { | ||
this.pushMessage(readable, messageBytes); | ||
await this.pushMessage(readable, messageBytes); | ||
} | ||
@@ -950,3 +950,3 @@ } | ||
if (this.bufferedMessages.length > 0) { | ||
this.pushMessage( | ||
await this.pushMessage( | ||
readable, | ||
@@ -953,0 +953,0 @@ this.bufferedMessages.shift() as Buffer | null |
@@ -44,5 +44,11 @@ /* | ||
export function subchannelAddressEqual( | ||
address1: SubchannelAddress, | ||
address2: SubchannelAddress | ||
address1?: SubchannelAddress, | ||
address2?: SubchannelAddress | ||
): boolean { | ||
if (!address1 && !address2) { | ||
return true; | ||
} | ||
if (!address1 || !address2) { | ||
return false; | ||
} | ||
if (isTcpSubchannelAddress(address1)) { | ||
@@ -49,0 +55,0 @@ return ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1696905
33613