summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/call-limit/README.md
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-04-12 21:47:49 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2017-04-25 10:52:01 -0400
commit00842604483e4c2e622dfdb3a97440e07646158f (patch)
treef3346902636a44b6037652523767636bf7e4f2c9 /deps/npm/node_modules/call-limit/README.md
parent061c5da010e0d249379618382a499840d38247b8 (diff)
downloadandroid-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.gz
android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.bz2
android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.zip
deps: upgrade npm to 4.5.0
PR-URL: https://github.com/nodejs/node/pull/12480 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/call-limit/README.md')
-rw-r--r--deps/npm/node_modules/call-limit/README.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/deps/npm/node_modules/call-limit/README.md b/deps/npm/node_modules/call-limit/README.md
new file mode 100644
index 0000000000..dc4f081dce
--- /dev/null
+++ b/deps/npm/node_modules/call-limit/README.md
@@ -0,0 +1,85 @@
+call-limit
+----------
+
+Limit the number of simultaneous executions of a async function.
+
+```javascript
+var fs = require('fs')
+var limit = require('call-limit')
+var limitedStat = limit(fs.stat, 5)
+```
+
+Or with promise returning functions:
+
+```javascript
+var fs = Bluebird.promisifyAll(require('fs'))
+var limit = require('call-limit')
+var limitedStat = limit.promise(fs.statAsync, 5)
+```
+
+### USAGE:
+
+Given that:
+
+```javascript
+var limit = require('call-limit')
+```
+
+### limit(func, maxRunning) → limitedFunc
+
+The returned function will execute up to maxRunning calls of `func` at once.
+Beyond that they get queued and called when the previous call completes.
+
+`func` must accept a callback as the final argument and must call it when
+it completes, or `call-limit` won't know to dequeue the next thing to run.
+
+By contrast, callers to `limitedFunc` do NOT have to pass in a callback, but
+if they do they'll be called when `func` calls its callback.
+
+### limit.promise(func, maxRunning) → limitedFunc
+
+The returned function will execute up to maxRunning calls of `func` at once.
+Beyond that they get queued and called when the previous call completes.
+
+`func` must return a promise.
+
+`limitedFunc` will return a promise that resolves with the promise returned
+from the call to `func`.
+
+### limit.method(class, methodName, maxRunning)
+
+This is sugar for:
+
+```javascript
+class.prototype.methodName = limit(class.prototype.methodName, maxRunning)
+```
+
+### limit.method(object, methodName, maxRunning)
+
+This is sugar for:
+
+```javascript
+object.methodName = limit(object.methodName, maxRunning)
+```
+
+For example `limit.promise.method(fs, 'stat', 5)` is the same as
+`fs.stat = limit.promise(fs.stat, 5)`.
+
+### limit.promise.method(class, methodName, maxRunning)
+
+This is sugar for:
+
+```javascript
+class.prototype.methodName = limit.promise(class.prototype.methodName, maxRunning)
+```
+
+### limit.promise.method(object, methodName, maxRunning)
+
+This is sugar for:
+
+```javascript
+object.methodName = limit.promise(object.methodName, maxRunning)
+```
+
+For example `limit.promise.method(fs, 'statAsync', 5)` is the same as
+`fs.statAsync = limit.promise(fs.statAsync, 5)`.