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.
cqueue
Advanced tools
Readme
cqueue is a Channel queue for holding a msg/value until it's taken. Promises are used for concurrent operations against the queue.
Put something in the queue, and then take it at some point in the future. The queue can only hold one value, and the response will indicate what your machine should do, i.e. "continue" or "pause".
const cqueue = require("cqueue");
let chan = cqueue();
function handle (arg) {
console.log(arg[1] || "empty");
}
chan.take().then(handle); // "empty"
chan.put("hello world");
chan.take().then(handle); // "hello world"
Array which can hold 1 value
Puts an item into the Channel, and the Promise receives an Array
method put
param {Mixed} arg Item
return {Object} Promise
chan.put(arg).then(function(state) {
if (state[0] === "continue") {
// arg was added to the channel
} else {
// arg is not in the channel
}
});
Takes an item from the Channel, and the Promise receives an Array
method take
return {Object} Promise
chan.take().then(function(state) {
if (state[0] === "continue") {
// state[1] was taken from the channel
} else {
// state[1] is null
}
});
Copyright (c) 2015 Jason Mulligan Licensed under the BSD-3 license.
FAQs
Channel queue with Promises
The npm package cqueue receives a total of 5 weekly downloads. As such, cqueue popularity was classified as not popular.
We found that cqueue 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.