Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.145.51.214
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
node_modules /
npm /
node_modules /
call-limit /
Delete
Unzip
Name
Size
Permission
Date
Action
CHANGELOG.md
619
B
-rw-r--r--
2021-03-10 14:36
LICENSE
723
B
-rw-r--r--
2021-03-10 14:36
README.md
2.13
KB
-rw-r--r--
2021-03-10 14:36
call-limit.js
2.69
KB
-rw-r--r--
2021-03-10 14:36
package.json
1.91
KB
-rw-r--r--
2021-03-10 14:36
Save
Rename
call-limit ---------- Limit the number of simultaneous executions of a async function. ```javascript const fs = require('fs') const limit = require('call-limit') const limitedStat = limit(fs.stat, 5) ``` Or with promise returning functions: ```javascript const fs = Bluebird.promisifyAll(require('fs')) const limit = require('call-limit') const limitedStat = limit.promise(fs.statAsync, 5) ``` ### USAGE: Given that: ```javascript const 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)`.