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

implemented drain() and drainSubscription() #275

Merged
merged 2 commits into from
Jun 7, 2019
Merged

implemented drain() and drainSubscription() #275

merged 2 commits into from
Jun 7, 2019

Conversation

aricart
Copy link
Member

@aricart aricart commented Jun 7, 2019

No description provided.

index.d.ts Outdated
* @param sid
* @param callback
*/
drain(sid: number, callback?:Function):void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If draining all why provide a sid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a typo - fixed.

lib/nats.js Outdated
@@ -1670,6 +1813,15 @@ Client.prototype.request = function(subject, opt_msg, opt_options, callback) {
opt_options = null;
}

if (this.draining) {
if (typeof callback === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems duplicated alot, maybe make a helper function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@aricart aricart merged commit 9a7e138 into master Jun 7, 2019
@aricart aricart deleted the drain branch June 7, 2019 03:21
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.

None yet

2 participants