gridfs-locks
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "gridfs-locks", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Distributed read/write locking based on MongoDB, primarily designed to make GridFS safe for concurrent access", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -94,3 +94,3 @@ # gridfs-locks | ||
As with any locking scheme, care must be taken to avoid creating [deadlocks](https://en.wikipedia.org/wiki/Deadlocks), and the built-in lock expiration pattern may be helpful in doing so. Note that the default configuration is that locks never expire, and attempts to obtain unavailable locks return immediately without a valid lock. These behaviors may be changed using the `lockExpiration`, `timeOut` and `pollingInterval` options. | ||
As with any locking scheme, care must be taken to avoid creating [deadlocks](https://en.wikipedia.org/wiki/Deadlocks), and the built-in lock expiration pattern may be helpful in doing so. Note that the default configuration is that locks never expire, and attempts to obtain unavailable locks invoke the callback immediately without waiting for a lock. These behaviors may be changed using the `lockExpiration`, `timeOut` and `pollingInterval` options. | ||
@@ -111,3 +111,3 @@ ## API | ||
pollingInterval: 5, // seconds between successive attempts to acquire a lock while waiting Default: 5 sec | ||
metaData: // metadata to store in the lock documents, useful for debugging Default: null | ||
metaData: null // metadata to store in the lock documents, useful for debugging Default: null | ||
w: 1 // mongodb write-concern Default: 1 | ||
@@ -134,3 +134,3 @@ }, | ||
pollingInterval: 5, // seconds between successive attempts to acquire a lock while waiting Default: 5 sec | ||
metaData: // metadata to store in the lock document, useful for debugging Default: null | ||
metaData: null // metadata to store in the lock document, useful for debugging Default: null | ||
} | ||
@@ -159,3 +159,3 @@ ); | ||
```js | ||
lock.obtainReadLock( | ||
lock.obtainWriteLock( | ||
function (err, l) { | ||
@@ -183,3 +183,3 @@ // err: any database error | ||
Reset the lock expiration time to `lockExpiration` seconds from now. | ||
Need more time? Reset the lock expiration time to `lockExpiration` seconds from now. | ||
@@ -186,0 +186,0 @@ ```js |
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
32338