Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
kanban
Advanced tools
Readme
Kanban is a node.js control-flow library. As the Japanese methodology, it is pull-based.
Node.js is all about concurrency: the more, the better. If you use external tools, or slow external services, you might reach a point were more concurrency reduce your throughput. You have to do something, and yet you have no data to decide.
Kanban focus is on recording stats and identifying bottlenecks. Then, it helps you improving your system, by specifying a work-in-progress limit to limit the concurrency of a processing step in your app.
npm install kanban --save
As in kanban, there is a Board and the processing of __Job__s happens in __Step__s.
First, you must create a new Board:
var kanban = require("kanban");
var board = new kanban.Board();
Then, you define some tasks:
board.defineStep("fast", { wip: 2 }, function (obj, done) {
console.log("Fast step started for " + obj);
setTimeout(function () {
console.log("Fast step done for " + obj);
done();
}, 1000);
});
board.defineStep("buffer");
board.defineStep("slow", { wip: 1 }, function (obj, done) {
console.log("Slow step started for " + obj);
setTimeout(function () {
console.log("Slow step done for " + obj);
done();
}, 5000);
});
Note that the second and third parameters are optional.
Finally you insert some jobs in the Board:
var print = function (err, job) {
// job is an instance of the Job class
console.dir(job);
};
for (var i = 0; i < 15; i++) {
board.insert(i, print);
}
You can find more examples in the examples folder.
The errors are handled in a pure node.js-style callbacks, so you MUST call the callback with the error as the first parameter.
If an error happens, the job is removed from the board and the function you inserted with the job is called.
instance.defineStep("a", function (obj, job, cb) {
cb(new Error("hello world"));
});
instance.insert({ a: "b" }, function (err) {
console.log(err)
});
It is possible to jump to a specific step in the board:
instance.defineStep("a", { wip: 1 }, function (obj, job, cb) {
job.jumpTo("c");
cb();
}).defineStep("b", { wip: 1 }, function (obj, cb) {
cb(new Error("hello world"));
}).defineStep("c").defineStep("d", function (obj, cb) {
cb();
});
instance.insert({ a: "b" }, function (err) {
console.log(err)
});
It is possible to specify a timeout for a given step, in milliseconds.
If a timeout happens, the job is removed from the board and the function you inserted with the job is called.
// define a timeout of a minute
instance.defineStep("a", { timeout: 60 * 1000 }, function (obj, job, cb) {
// this function is stuck somewhere, it will not complete
});
instance.insert({ a: "b" }, function (err) {
console.log(err)
});
Copyright (c) 2013 Matteo Collina, http://matteocollina.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Kanban is a node.js control-flow library. As the Japanese methodology, it is pull-based.
The npm package kanban receives a total of 20 weekly downloads. As such, kanban popularity was classified as not popular.
We found that kanban 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.