-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support channel options like highwatermark #778
base: main
Are you sure you want to change the base?
Conversation
if (arguments.length === 1) { | ||
cb = options; | ||
options = undefined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain backwards compatibility if no options are specified
var ch = new Channel(this.connection); | ||
ch.setOptions(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a setter to specify the channel options to avoid making a breaking change to the Channel constructor
if (arguments.length === 1) { | ||
cb = options; | ||
options = undefined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintain backwards compatibility if no options are specified
var ch = new ConfirmChannel(this.connection); | ||
ch.setOptions(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a setter to specify the channel options to avoid making a breaking change to the Channel constructor
channelOptions.highWaterMark = baseline * 2; | ||
done(); | ||
}) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "test" finds how much the local environment running the test can take before the buffer is saturated, then updates the channel options for the next test. It's more than a little hacky, but I couldn't think of a better way to get the test working reliably.
Allows setting channel options like highwatermark. See #264