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

Do not block while waiting for previous message to be confirmed #84

Merged

Conversation

ahem
Copy link
Contributor

@ahem ahem commented May 1, 2019

Before ChannelWrapper would always wait for a message to be confirmed before publishing the next message. This commit changes the behaviour so messages are published to the lower level channel as fast as they are received by the ChannelWrapper.

This means that for code like this, all messages will by published at once, instead of waiting for each message to be confirmed before publishing the next:

await Promise.all(messages.map(message => channelWrapper.publish(message)))

Before ChannelWrapper would always wait for a message to be confirmed
before publishing the next message. This commit changes the behaviour so
messages are published to the lower level channel as fast as they are
received by the ChannelWrapper.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 98.901% when pulling 0a96f85 on ahem:do-not-block-while-waiting-for-confirm into fb64d55 on benbria:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 98.901% when pulling 0a96f85 on ahem:do-not-block-while-waiting-for-confirm into fb64d55 on benbria:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 98.901% when pulling 0a96f85 on ahem:do-not-block-while-waiting-for-confirm into fb64d55 on benbria:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 98.901% when pulling 0a96f85 on ahem:do-not-block-while-waiting-for-confirm into fb64d55 on benbria:master.

return sendPromise;
})
.then(
result => {
this._messages.shift();
this._unconfirmedMessages.shift();
Copy link
Owner

Choose a reason for hiding this comment

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

This assumes messages will be confirmed in the same order they were added to _unconfirmedMessages, but that sounds reasonable.

@jwalton
Copy link
Owner

jwalton commented May 1, 2019

This should fix #65, too.

@jwalton jwalton merged commit ceacfb5 into jwalton:master May 1, 2019
@jwalton
Copy link
Owner

jwalton commented May 21, 2019

Oops - didn't realize your commit message didn't conform to angular commit style - no build was kicked off for this.

benbriadeploy pushed a commit that referenced this pull request May 21, 2019
## [2.3.2](v2.3.1...v2.3.2) (2019-05-21)

### Bug Fixes

* Null delta to get semantic-release to pick up [#65](#65).  Fix [#84](#84). ([9737135](9737135))
@benbriadeploy
Copy link

🎉 This PR is included in version 2.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants