projects
/
squeep-amqp-helper
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update dependencies and devDependencies, fix lint issues
[squeep-amqp-helper]
/
lib
/
publisher.js
diff --git
a/lib/publisher.js
b/lib/publisher.js
index 19987f1fb37abc76d0f02dcbf9d666112242c0b4..0c7ac3d743d77679e51e334fdc26a9cdbc04e1ef 100644
(file)
--- a/
lib/publisher.js
+++ b/
lib/publisher.js
@@
-16,11
+16,17
@@
class Publisher extends Base {
persistent: true,
};
persistent: true,
};
+ /**
+ * @typedef {object} PublishOptions
+ * @property {number} timestamp timestamp in ms, defaults to current
+ * @property {boolean} persistent defaults to true
+ */
/**
* Send a message to an exchange.
/**
* Send a message to an exchange.
- * @param {String} name
- * @param {*} content
- * @param {Object} options
+ * @param {string} name name
+ * @param {*} content message content
+ * @param {PublishOptions} options options
+ * @returns {Promise<void>}
*/
async publish(name, content, options) {
const _scope = _fileScope('publish');
*/
async publish(name, content, options) {
const _scope = _fileScope('publish');
@@
-31,7
+37,7
@@
class Publisher extends Base {
content = Buffer.from(typeof(content) === 'object' ? JSON.stringify(content) : content);
}
content = Buffer.from(typeof(content) === 'object' ? JSON.stringify(content) : content);
}
- const timestamp =
(new Date()).getTime
();
+ const timestamp =
Date.now
();
options = {
timestamp,
...Publisher.publishDefaults,
options = {
timestamp,
...Publisher.publishDefaults,
@@
-86,8
+92,7
@@
class Publisher extends Base {
/**
* Producer only needs to plumb the exchange it sends to.
/**
* Producer only needs to plumb the exchange it sends to.
- *
- * @param {String} name
+ * @param {string} name name
*/
async establishAMQPPlumbing(name) {
const _scope = _fileScope('establishAMQPPlumbing');
*/
async establishAMQPPlumbing(name) {
const _scope = _fileScope('establishAMQPPlumbing');