1.1.1 • Published 2 years ago

@lauf/lock v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Lightweight Lock for Mutual Exclusion

codecov

Lauf Lock

Logo - Diego Naive, Noun Project.

Install

npm install @lauf/lock --save

@lauf/lock is an implementation of Mutual Exclusion or Mutex. It is incredibly lightweight with no dependencies and is suitable for adoption server-side or client-side in Typescript or Javascript.

To get a lock on a particular key, call lock.acquire(key). The Promise returned will block until every prior requester for that key has already acquired and released their lock, meaning it's your turn. The promise will then resolve to your very own Release function, indicating you have the lock. Finally, call the Release function to notify you have given up the lock.

Browse the API.

1.1.1

2 years ago

1.1.0

2 years ago

1.1.0-alpha.1

2 years ago

1.1.0-alpha.0

2 years ago

2.0.0-alpha.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago