![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
at-a-time
allows you to do do asynchronous operations simultaneously but with a max number of operations going at any one time.
Promise.all()
allows you to simultaneously do asynchronous operations and a for
loop in an async function allows you to sequentially do asynchronous operations. But, sometimes you have more operations than you can handle at once and it would take too long to handle them sequentially. at-a-time
allows you to do do asynchronous operations simultaneously but with a max number of operations going at any one time.
$ npm install at-a-time
// import library
const atATime = require('at-a-time');
const endpoints = [
'https://api.something.com/12345',
'https://api.something.com/23451',
'https://api.something.com/34512',
'https://api.something.com/45123',
'https://api.something.com/51234',
'https://api.something.com/23456',
'https://api.something.com/62345',
'https://api.something.com/56234',
'https://api.something.com/45623',
'https://api.something.com/34562'
];
// create an array of Promise-returning functions
const operations = endpoints
.map(e => () => request.get(e));
// Work through the operations keeping two
// simultaneous operations going at a time.
// Usage with manual Promise handling
atATime(2, operations)
.then(res => {
console.log(res); // array of responses in order
})
.catch(err => {
// handle error
});
// Usage within an sync function
async function() {
try {
const res = await atATime(2, operations);
console.log(res); // array of responses in order
} catch(err) {
// handle error
}
};
// Usage within a generator function
co(function*() {
try {
const res = yield atATime(2, operations);
console.log(res); // array of responses in order
} catch(err) {
// handle error
}
});
$ npm install
$ npm test
Apache License Version 2.0
FAQs
at-a-time
The npm package at-a-time receives a total of 1 weekly downloads. As such, at-a-time popularity was classified as not popular.
We found that at-a-time 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.