Skip to content

Commit 19301ef

Browse files
author
SGrondin
committed
1.5.3 CS 1.8, README, packaging stuff
1 parent 5bb19b7 commit 19301ef

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Same parameters as the constructor, pass ```null``` to skip a parameter and keep
118118

119119
**Note:** Changing `maxConcurrent` and `minTime` will not affect requests that have already been scheduled for execution.
120120

121-
For example, imagine that 3 minute-long requests are submitted at time T+0 with `maxConcurrent = 0` and `minTime = 2000`. The requests will be launched at T+0 seconds, T+2 seconds and T+4 seconds respectively. If right after adding the requests to Bottleneck, you were to call `limiter.changeSettings(1);`, it won't change the fact that there will be 3 requests running at the same time for roughly 60 seconds as in this example they each take a minute to complete. Once again, `changeSettings` only affects requests that have not yet been submitted.
121+
For example, imagine that 3 60-second requests are submitted at time T+0 with `maxConcurrent = 0` and `minTime = 2000`. The requests will be launched at T+0 seconds, T+2 seconds and T+4 seconds respectively. If right after adding the requests to Bottleneck, you were to call `limiter.changeSettings(1);`, it won't change the fact that there will be 3 requests running at the same time for roughly 60 seconds. Once again, `changeSettings` only affects requests that have not yet been *submitted*.
122122

123-
This is by design, as Bottleneck made a promise to execute those requests according to the settings valid at the time. Changing settings afterwards should not retroactively affect space & time nor break previous assumptions, as that would make code very error-prone and Bottleneck a tool that cannot be relied upon.
123+
This is by design, as Bottleneck made a promise to execute those requests according to the settings valid at the time. Changing settings afterwards should not break previous assumptions, as that would make code very error-prone and Bottleneck a tool that cannot be relied upon.
124124

125125

126126
###changePenalty()
@@ -183,9 +183,10 @@ req.end();
183183

184184
This is the right way to do it:
185185
```javascript
186-
limiter.submit(function(){
186+
limiter.submit(function(cb){
187187
var req = http.request(options, function(res){
188188
//do stuff with res
189+
cb();
189190
});
190191
req.write("some string", "utf8");
191192
req.end();

bottleneck.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2-
// Generated by CoffeeScript 1.7.1
2+
// Generated by CoffeeScript 1.8.0
33
(function() {
44
var Bottleneck,
55
__slice = [].slice;
@@ -143,7 +143,7 @@
143143

144144
},{}],2:[function(require,module,exports){
145145
(function (global){
146-
// Generated by CoffeeScript 1.7.1
146+
// Generated by CoffeeScript 1.8.0
147147
(function() {
148148
module.exports = require("./Bottleneck");
149149

bower.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bottleneck",
33
"main": "bottleneck.js",
4-
"version": "1.5.2",
4+
"version": "1.5.3",
55
"homepage": "https://github.com/SGrondin/bottleneck",
66
"authors": [
77
"SGrondin <github@simongrondin.name>"
@@ -15,6 +15,7 @@
1515
"async",
1616
"rate",
1717
"limiter",
18+
"limiting",
1819
"throttle",
1920
"throttling",
2021
"load",

lib/Bottleneck.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bottleneck",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"description": "Async rate limiter",
55
"main": "lib/index.js",
66
"scripts": {
@@ -14,10 +14,14 @@
1414
"keywords": [
1515
"async rate limiter",
1616
"rate limiter",
17+
"rate limiting",
18+
"async",
19+
"rate",
20+
"limiting",
21+
"limiter",
1722
"throttle",
1823
"throttling",
1924
"load",
20-
"limiter",
2125
"ddos"
2226
],
2327
"author": {
@@ -28,7 +32,7 @@
2832
"url": "https://github.com/SGrondin/bottleneck/issues"
2933
},
3034
"devDependencies":{
31-
"coffee-script": "1.7.x",
35+
"coffee-script": "1.8.x",
3236
"browserify": "*",
3337
"uglify-js": "*"
3438
}

0 commit comments

Comments
 (0)