@google-cloud/pubsub
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -33,8 +33,8 @@ /*! | ||
* redelivered and make the maxMessages option behave more predictably. | ||
* @property {number} [maxBytes] The desired amount of memory to allow message | ||
* data to consume, defaults to 20% of available memory. Its possible that | ||
* this value will be exceeded since messages are received in batches. | ||
* @property {number} [maxExtension=Infinity] The maximum duration (in seconds) | ||
* @property {number} [maxBytes=104857600] The desired amount of memory to | ||
* allow message data to consume. (Default: 100MB) It's possible that this | ||
* value will be exceeded, since messages are received in batches. | ||
* @property {number} [maxExtension=60] The maximum duration (in seconds) | ||
* to extend the message deadline before redelivering. | ||
* @property {number} [maxMessages=100] The desired number of messages to allow | ||
* @property {number} [maxMessages=1000] The desired number of messages to allow | ||
* in memory before pausing the message stream. Unless allowExcessMessages | ||
@@ -41,0 +41,0 @@ * is set to false, it is very likely that this value will be exceeded since |
@@ -19,3 +19,3 @@ "use strict"; | ||
const events_1 = require("events"); | ||
const os_1 = require("os"); | ||
const default_options_1 = require("./default-options"); | ||
/** | ||
@@ -29,8 +29,8 @@ * @typedef {object} FlowControlOptions | ||
* redelivered and make the maxMessages option behave more predictably. | ||
* @property {number} [maxBytes] The desired amount of memory to allow message | ||
* data to consume, defaults to 20% of available memory. Its possible that | ||
* this value will be exceeded since messages are received in batches. | ||
* @property {number} [maxExtension=Infinity] The maximum duration (in seconds) | ||
* @property {number} [maxBytes=104857600] The desired amount of memory to | ||
* allow message data to consume. (Default: 100MB) It's possible that this | ||
* value will be exceeded, since messages are received in batches. | ||
* @property {number} [maxExtension=60] The maximum duration (in seconds) | ||
* to extend the message deadline before redelivering. | ||
* @property {number} [maxMessages=100] The desired number of messages to allow | ||
* @property {number} [maxMessages=1000] The desired number of messages to allow | ||
* in memory before pausing the message stream. Unless allowExcessMessages | ||
@@ -164,5 +164,5 @@ * is set to false, it is very likely that this value will be exceeded since | ||
allowExcessMessages: true, | ||
maxBytes: os_1.freemem() * 0.2, | ||
maxExtension: Infinity, | ||
maxMessages: 100, | ||
maxBytes: default_options_1.defaultOptions.maxOutstandingBytes, | ||
maxExtension: default_options_1.defaultOptions.maxExtensionMinutes, | ||
maxMessages: default_options_1.defaultOptions.maxOutstandingMessages, | ||
}; | ||
@@ -169,0 +169,0 @@ this._options = Object.assign(defaults, options); |
@@ -23,2 +23,3 @@ "use strict"; | ||
const pull_retry_1 = require("./pull-retry"); | ||
const default_options_1 = require("./default-options"); | ||
/*! | ||
@@ -37,3 +38,3 @@ * Frequency to ping streams. | ||
highWaterMark: 0, | ||
maxStreams: 5, | ||
maxStreams: default_options_1.defaultOptions.maxStreams, | ||
timeout: 300000, | ||
@@ -40,0 +41,0 @@ }; |
@@ -26,2 +26,3 @@ "use strict"; | ||
const message_stream_1 = require("./message-stream"); | ||
const default_options_1 = require("./default-options"); | ||
/** | ||
@@ -340,12 +341,12 @@ * Date object with nanosecond precision. Supports all standard Date arguments | ||
} | ||
// in the event that the user has specified the maxMessages option, we want | ||
// to make sure that the maxStreams option isn't higher | ||
// it doesn't really make sense to open 5 streams if the user only wants | ||
// In the event that the user has specified the maxMessages option, we want | ||
// to make sure that the maxStreams option isn't higher. | ||
// It doesn't really make sense to open 5 streams if the user only wants | ||
// 1 message at a time. | ||
if (options.flowControl) { | ||
const { maxMessages = 100 } = options.flowControl; | ||
const { maxMessages = default_options_1.defaultOptions.maxOutstandingMessages, } = options.flowControl; | ||
if (!options.streamingOptions) { | ||
options.streamingOptions = {}; | ||
} | ||
const { maxStreams = 5 } = options.streamingOptions; | ||
const { maxStreams = default_options_1.defaultOptions.maxStreams } = options.streamingOptions; | ||
options.streamingOptions.maxStreams = Math.min(maxStreams, maxMessages); | ||
@@ -352,0 +353,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -7,2 +7,9 @@ # Changelog | ||
## [1.4.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.3.0...v1.4.0) (2020-01-24) | ||
### Features | ||
* **defaults:** update defaults for the node client library to match other pub/sub libraries ([#859](https://www.github.com/googleapis/nodejs-pubsub/issues/859)) ([8d6c3f7](https://www.github.com/googleapis/nodejs-pubsub/commit/8d6c3f778cbe00cde8b273b25bc50b491687396b)) | ||
## [1.3.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.2.0...v1.3.0) (2020-01-14) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/pubsub", | ||
"description": "Cloud Pub/Sub Client Library for Node.js", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Google Inc.", |
@@ -131,2 +131,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
| Synchronous Pull | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/synchronousPull.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/synchronousPull.js,samples/README.md) | | ||
| Synchronous Pull With Lease Management | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/synchronousPullWithLeaseManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/synchronousPullWithLeaseManagement.js,samples/README.md) | | ||
| Test Subscription Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/testSubscriptionPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testSubscriptionPermissions.js,samples/README.md) | | ||
@@ -133,0 +134,0 @@ | Test Topic Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/testTopicPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testTopicPermissions.js,samples/README.md) | |
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 too big to display
3406452
131
55629
176