Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@types/semaphore] interface Task () method should have an extra optional parameter #68377

Open
DeathKing opened this issue Jan 30, 2024 · 0 comments

Comments

@DeathKing
Copy link

The Task interface is defined as:

declare namespace semaphore {
interface Task {
(): void;
}
interface Semaphore {
capacity: number;
current: number;
available(n: number): boolean;
take(task: Task): void;

while take() function could be invoked with a unary function like:

var sem = require('semaphore')()
sem.take(function(leave) {
    console.log('about to leave')
    leave()
})

reference: abrkn/semaphore.js#2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant