-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with replying to RPC messages using Promises (#44)
* Fix issues with replying to RPC messages using Promises Issue 1: If a message is received with the replyTo field set (an RPC message) and the onMessage function that's passed to activateConsumer() or startConsumer() returns a Promise and the Promise isn't an ES6 Promise, a JSON version of the Promise itself may be returned in the reply message instead of the Promise's resolved value. https://stackoverflow.com/questions/27746304/how-do-i-tell-if-an-object-is-a-promise Issue 2: If a message is received with the replyTo field set (an RPC message) and the onMessage function that's passed to startConsumer() returns a Promise, the Promise's resolved value isn't returned in the reply message. Instead a JSON version of the entire Promise is returned. * Rebuild transpiled library from Typescript source Update version information in package file to match latest released version * Allow the onMessage callback that's passed to activateConsumer() and startConsumer() to return a promise regardless of whether or not the replyTo field is set. startConsumer() can automatically ack the message. If noAck == false and manualAck == false and onMessage returns a promise, wait until the promise is resolved before acknowledging the message. * Rebuild transpiled library from Typescript source
- Loading branch information
1 parent
fb19802
commit 0ca8250
Showing
3 changed files
with
89 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters