Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cressie176
Copy link
Collaborator

Allows setting channel options like highwatermark. See #264

if (arguments.length === 1) {
cb = options;
options = undefined;
}
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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;
}
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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

test/callback_api.js Outdated Show resolved Hide resolved
test/callback_api.js Outdated Show resolved Hide resolved
channelOptions.highWaterMark = baseline * 2;
done();
})
});
Copy link
Collaborator Author

@cressie176 cressie176 Nov 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant