Comparing version 0.0.1 to 0.0.2
15
index.js
@@ -9,4 +9,17 @@ module.exports = create; | ||
promise: lib.promise(nextPromise), | ||
stream: lib.stream(nextPromise) | ||
stream: lib.stream(nextPromise), | ||
unlimited: unlimited | ||
}; | ||
} | ||
function unlimited(depth) { | ||
return unlimited; | ||
} | ||
create.unlimited = unlimited.unlimited = unlimited; | ||
['cb', 'promise', 'stream'].forEach(function(prop) { | ||
unlimited[prop] = identity; | ||
}); | ||
function identity(obj) {return obj;} |
{ | ||
"name": "gulp-lock", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "control concurrency of gulp tasks.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -66,1 +66,30 @@ gulp-lock | ||
maximize concurrency (within the limits set by the lock). | ||
###unlimited | ||
The "unlimited" lock provides a convenient way to disable the effects of | ||
`gulp-lock`. It provides an identical api to the normal locks, but all wrapper | ||
functions are actually identity functions that just return the function without | ||
wrapping it. A potential usage would be to only enforce concurrency restrictions | ||
on Travis. Travis vms often suffer from slower network/disk access than developer | ||
machines, and you are probably willing to trade reduced concurrency (i.e. speed) | ||
for added dependability on your travis build. | ||
```javascript | ||
var lock = require('gulp-lock'); | ||
// only restrict concurrency on travis | ||
var myLock = process.env.TRAVIS ? lock(1) : lock.unlimited; | ||
// lock will have no affect outside of travis | ||
gulp.task('myTask', myLock.stream(function(){/*...*/}); | ||
``` | ||
###not really a gulp plugin | ||
While this is listed as a gulp plugin, it actually has no dependency on gulp | ||
or any vinyl libraries. It can be used to control concurrency for any async | ||
functions that either: | ||
1. take a callback as their first arg. | ||
2. return a promise. | ||
3. return a stream. |
8688
139
95