
Security News
arXiv Is Rate Limiting Authors Following a Flood of AI Slop Submissions
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.
@haimkastner/await-semaphore
Advanced tools
Awaitable semaphore/mutex
A semaphore implementation using ES6 promises and supporting 3 styles:
Also includes Mutex as a convenience for new Semaphore(1).
Create a new semaphore with the given count.
import {Semaphore} from 'await-semaphore';
var semaphore = new Semaphore(10);
Acquire the semaphore and returns a promise for the release function. Be sure to handle release for exception case.
semaphore.acquire()
.then(release => {
//critical section...
doSomething()
.then(res => {
//...
release();
})
.catch(err => {
//...
release();
});
});
Alternate method for using the semaphore by providing a thunk. This automatically handles acquire/release.
semaphore.use(() => {
//critical section...
});
An alias for new Semaphore(1). Mutex has the same methods as Semaphore.
import {Mutex} from 'await-semaphore';
var mutex = new Mutex();
Create a version of fetch() with concurrency limited to 10.
var semaphore = new Semaphore(10);
async function niceFetch(url) {
var release = await semaphore.acquire();
var result = await fetch(url);
release();
return result;
}
var semaphore = new Semaphore(10);
function niceFetch(url) {
return semaphore.use(() => fetch(url));
}
var semaphore = new Semaphore(10);
function niceFetch(url) {
return semaphore.acquire()
.then(release => {
return fetch(url)
.then(result => {
release();
return result;
});
});
}
In order to avoid dead-lock in extreme situations, or for any other needs, there is an option to set a timeout to the semaphore,
so after X time duration the lock will be released although the release() have been never called.
import { Duration } from 'unitsnet-js';
var semaphore = new Semaphore(1, Duration.FromMinutes(5));
// Use the semaphore...
FAQs
Awaitable semaphore/mutex
We found that @haimkastner/await-semaphore 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.

Security News
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.

Research
/Security News
A new GhostAction wave hits hundreds of GitHub repos, expanding CI/CD secret theft to cloud and AI credentials in source code and git history.

Research
/Security News
Tensorlake npm SDK version 0.5.144 was compromised in a ChainDrop / Shai-Hulud attack, delivering credential-stealing malware.