async-mutex
Advanced tools
Comparing version 0.2.1 to 0.2.2
# Changelog | ||
## 0.2.2 | ||
* Improve compatibility with older versions of node 13, thanks to @josemiguelmelo | ||
## 0.2.1 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "async-mutex", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A mutex for guarding async workflows", | ||
@@ -79,3 +79,4 @@ "scripts": { | ||
"import": "./index.mjs", | ||
"require": "./lib/index.js" | ||
"require": "./lib/index.js", | ||
"default": "./lib/index.js" | ||
}, | ||
@@ -82,0 +83,0 @@ "dependencies": { |
@@ -45,3 +45,3 @@ [![Build Status](https://travis-ci.org/DirtyHairy/async-mutex.svg?branch=master)](https://travis-ci.org/DirtyHairy/async-mutex) | ||
As long as the semaphore value is positive, locking it will return the current value | ||
and the locking process will continue execution immediatelly; the semaphore will | ||
and the locking process will continue execution immediately; the semaphore will | ||
be decremented upon locking. Releasing the lock will increment the semaphore again. | ||
@@ -72,2 +72,5 @@ | ||
**WARNING:** Node 13 versions < 13.2.0 fail to import this package correctly. | ||
Node 12 and earlier are fine, as are newer versions of node 13. | ||
## Importing | ||
@@ -119,4 +122,3 @@ | ||
try { | ||
const i = await store.get(); | ||
await store.put(i + 1); | ||
// ... | ||
} finally { | ||
@@ -156,3 +158,3 @@ release(); | ||
`runExclusive` schedules the supplied callback to be run once the mutex is unlocked. | ||
The function may return a promise. Once the promise is resolved or rejected (or immediatelly after | ||
The function may return a promise. Once the promise is resolved or rejected (or immediately after | ||
execution if an immediate value was returned), | ||
@@ -234,3 +236,3 @@ the mutex is released. `runExclusive` returns a promise that adopts the state of the function result. | ||
The callback will receive the current value of the semaphore as its argument. | ||
The function may return a promise. Once the promise is resolved or rejected (or immediatelly after | ||
The function may return a promise. Once the promise is resolved or rejected (or immediately after | ||
execution if an immediate value was returned), | ||
@@ -237,0 +239,0 @@ the semaphore is released. `runExclusive` returns a promise that adopts the state of the function result. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32880
272