Constructor
new RateLimit(keyopt, cacheObjopt)
Initializes the delay to the past so the first call immediately runs
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
string |
<optional> |
key for the backing map in the cache |
cacheObj |
object |
<optional> |
cache object to use (defaults to cache.private if key is provided) |
- Source:
Methods
run(func)
Parameters:
| Name | Type | Description |
|---|---|---|
func |
function | action to run if it's been long enough |
- Source: