You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@google-cloud/pubsub

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/pubsub - npm Package Compare versions

Comparing version

to
2.7.0

13

build/src/message-stream.d.ts

@@ -70,3 +70,2 @@ /*!

export declare class MessageStream extends PassThrough {
destroyed: boolean;
private _keepAliveHandle;

@@ -82,7 +81,15 @@ private _fillHandle?;

*
* @param {error?} err An error to emit, if any.
* @param {error?} error An error to emit, if any.
* @private
*/
destroy(err?: Error): void;
destroy(error?: Error | null): void;
/**
* Destroys the stream and any underlying streams.
*
* @param {error?} error An error to emit, if any.
* @param {Function} callback Callback for completion of any destruction.
* @private
*/
_destroy(error: Error | null, callback: (error: Error | null) => void): void;
/**
* Adds a StreamingPull stream to the combined stream.

@@ -89,0 +96,0 @@ *

@@ -97,3 +97,2 @@ "use strict";

super({ objectMode: true, highWaterMark: options.highWaterMark });
this.destroyed = false;
this._options = options;

@@ -110,9 +109,20 @@ this._retrier = new pull_retry_1.PullRetry();

*
* @param {error?} err An error to emit, if any.
* @param {error?} error An error to emit, if any.
* @private
*/
destroy(err) {
destroy(error) {
// We can't assume Node has taken care of this in <14.
if (this.destroyed) {
return;
}
super.destroy(error ? error : undefined);
}
/**
* Destroys the stream and any underlying streams.
*
* @param {error?} error An error to emit, if any.
* @param {Function} callback Callback for completion of any destruction.
* @private
*/
_destroy(error, callback) {
this.destroyed = true;

@@ -124,11 +134,3 @@ clearInterval(this._keepAliveHandle);

}
if (typeof super.destroy === 'function') {
return super.destroy(err);
}
process.nextTick(() => {
if (err) {
this.emit('error', err);
}
this.emit('close');
});
callback(error);
}

@@ -175,4 +177,8 @@ /**

streamAckDeadlineSeconds: this._subscriber.ackDeadline,
maxOutstandingMessages: this._subscriber.maxMessages,
maxOutstandingBytes: this._subscriber.maxBytes,
maxOutstandingMessages: this._subscriber.useLegacyFlowControl
? 0
: this._subscriber.maxMessages,
maxOutstandingBytes: this._subscriber.useLegacyFlowControl
? 0
: this._subscriber.maxBytes,
};

@@ -179,0 +185,0 @@ delete this._fillHandle;

@@ -108,2 +108,3 @@ /*!

flowControl?: FlowControlOptions;
useLegacyFlowControl?: boolean;
streamingOptions?: MessageStreamOptions;

@@ -119,2 +120,5 @@ enableOpenTelemetryTracing?: boolean;

* @property {FlowControlOptions} [flowControl] Flow control options.
* @property {boolean} [useLegacyFlowControl] Disables enforcing flow control
* settings at the Cloud PubSub server and uses the less accurate method
* of only enforcing flow control at the client side.
* @property {MessageStreamOptions} [streamingOptions] Streaming options.

@@ -135,2 +139,3 @@ */

maxBytes: number;
useLegacyFlowControl: boolean;
isOpen: boolean;

@@ -137,0 +142,0 @@ private _acks;

@@ -188,2 +188,5 @@ "use strict";

* @property {FlowControlOptions} [flowControl] Flow control options.
* @property {boolean} [useLegacyFlowControl] Disables enforcing flow control
* settings at the Cloud PubSub server and uses the less accurate method
* of only enforcing flow control at the client side.
* @property {MessageStreamOptions} [streamingOptions] Streaming options.

@@ -206,2 +209,3 @@ */

this.maxBytes = default_options_1.defaultOptions.subscription.maxOutstandingBytes;
this.useLegacyFlowControl = false;
this.isOpen = false;

@@ -346,2 +350,3 @@ this._isUserSetDeadline = false;

}
this.useLegacyFlowControl = options.useLegacyFlowControl || false;
if (options.flowControl) {

@@ -348,0 +353,0 @@ this.maxMessages =

@@ -7,2 +7,16 @@ # Changelog

## [2.7.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.6.0...v2.7.0) (2020-11-30)
### Features
* Enable server side flow control by default with the option to turn it off ([#1147](https://www.github.com/googleapis/nodejs-pubsub/issues/1147)) ([a9c7e0b](https://www.github.com/googleapis/nodejs-pubsub/commit/a9c7e0b216a0c228793eeead150cc21b16bd2dcb))
* update generator to a new version ([#1157](https://www.github.com/googleapis/nodejs-pubsub/issues/1157)) ([3b1e99e](https://www.github.com/googleapis/nodejs-pubsub/commit/3b1e99ebde72653a1fa0317820d1218e1c04eb8f))
### Bug Fixes
* do not modify options object, use defaultScopes ([#1148](https://www.github.com/googleapis/nodejs-pubsub/issues/1148)) ([4745c10](https://www.github.com/googleapis/nodejs-pubsub/commit/4745c10eb062b1816516ce79cec496b388e48b2b))
* node 14+ changes how multiple destroy() calls work ([#1153](https://www.github.com/googleapis/nodejs-pubsub/issues/1153)) ([e421749](https://www.github.com/googleapis/nodejs-pubsub/commit/e42174987ec4669b31882943606c871c9b6c08d7))
## [2.6.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.5.0...v2.6.0) (2020-10-20)

@@ -9,0 +23,0 @@

{
"name": "@google-cloud/pubsub",
"description": "Cloud Pub/Sub Client Library for Node.js",
"version": "2.6.0",
"version": "2.7.0",
"license": "Apache-2.0",

@@ -63,3 +63,3 @@ "author": "Google Inc.",

"google-auth-library": "^6.1.2",
"google-gax": "^2.7.0",
"google-gax": "^2.9.2",
"is-stream-ended": "^0.1.4",

@@ -66,0 +66,0 @@ "lodash.snakecase": "^4.1.1",

@@ -176,3 +176,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

Client libraries targetting some end-of-life versions of Node.js are available, and
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).

@@ -179,0 +179,0 @@ The dist-tags follow the naming convention `legacy-(version)`.

Sorry, the diff of this file is too big to display

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