Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ali-ons

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ali-ons - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

6

History.md
3.5.0 / 2019-03-25
==================
**features**
* [[`073058b9d8`](https://github.com/ali-sdk/ali-ons/commit/073058b9d8)] - **feat**: support delay deliver message (#65) (MarvinWilliam <<la805779602@hotmail.com>>)
3.4.0 / 2019-03-13

@@ -3,0 +9,0 @@ ==================

3

lib/message/message_const.js

@@ -29,1 +29,4 @@ 'use strict';

exports.KEY_SEPARATOR = ' ';
// 延迟消息配置key
exports.SYSTEM_PROP_KEY_STARTDELIVERTIME = '__STARTDELIVERTIME';

@@ -134,4 +134,21 @@ 'use strict';

}
/**
* 延迟执行的时间点,毫秒
* @param {number} delayTime 延迟执行目标时间戳
*/
setStartDeliverTime(delayTime) {
this.properties[MessageConst.SYSTEM_PROP_KEY_STARTDELIVERTIME] = delayTime;
}
/**
* 获取消息延迟时间
* @return {number} 延迟执行目标时间戳
*/
getStartDeliverTime() {
return this.properties[MessageConst.SYSTEM_PROP_KEY_STARTDELIVERTIME] || 0;
}
}
module.exports = Message;

2

package.json
{
"name": "ali-ons",
"version": "3.4.0",
"version": "3.5.0",
"description": "Aliyun Open Notification Service Client",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -74,2 +74,5 @@ ali-ons

// delay consume
// msg.setStartDeliverTime(Date.now() + 5000);
const sendResult = await producer.send(msg);

@@ -76,0 +79,0 @@ console.log(sendResult);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc