Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
dtimer
Advanced tools
Readme
Distributed timer backed by Redis.
In a clustered server environment, you'd occasionally need to process a task after a certain period of time. The setTimeout() may not be suitable because the process may die for whatever reason, the timed events would also be lost. Ideally, you'd want to store these timed events on a central storage, then have a cluster of listeners handle the due events. If you are already using Redis, then this dtimer would be a handy solution for you.
$ npm install dtimer
maxEvents
no limit
(-1){
"2": {
"expireAt": 1410502530320,
"event": {
"msg": "hello"
}
},
"3": {
"expireAt": 1410502531321,
"event": {
"msg": "hello"
}
}
}
var DTimer = require('dtimer').DTimer;
var redis = require('redis');
var pub = redis.createClient();
var sub = redis.createClient();
var dt = new DTimer('ch1', pub, sub)
dt.on('event', function (ev) {
// do something with ev
})
dt.on('error', function (err) {
// handle error
})
dt.join(function (err) {
if (err) {
// join failed
return;
}
// join successfully
})
dt.post({msg:'hello'}, 200, function (err, evId) {
if (err) {
// failed to post event
return;
}
// posted event successfully
// If you need to cancel this event, then do:
//dt.cancel(evId, function (err) {...});
})
FAQs
Distributed timer backed by Redis.
The npm package dtimer receives a total of 189 weekly downloads. As such, dtimer popularity was classified as not popular.
We found that dtimer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).