Commit 735a701 1 parent 13125f3 commit 735a701 Copy full SHA for 735a701
File tree 3 files changed +9
-11
lines changed
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1
- # rlimit [ ![ Build Status] ( https://secure.travis-ci.org/AfterShip/rate-limiter.png?branch=master )] ( http://travis-ci.org/AfterShip/rate-limiter )
2
-
3
- ## This is unstable branch, please use 1.x version for production
1
+ # rate-limiter [ ![ Build Status] ( https://secure.travis-ci.org/AfterShip/rate-limiter.png?branch=master )] ( http://travis-ci.org/AfterShip/rate-limiter )
4
2
5
3
The Real Redis Rate Limiter for Node.js
6
4
Original file line number Diff line number Diff line change 1
1
/*
2
- * r3limiter
2
+ * Limiter
3
3
* https://github.com/AfterShip/r3limiter
4
4
*
5
5
* Copyright (c) 2015 AfterShip
12
12
var fs = require ( 'fs' ) ;
13
13
14
14
/**
15
- * R3Limiter constructor
15
+ * Limiter constructor
16
16
* options:
17
17
* {
18
18
* redis_client: redis connection client instance
24
24
* @param options {Object} - option parameters
25
25
* @constructor
26
26
*/
27
- function R3Limiter ( options ) {
27
+ function Limiter ( options ) {
28
28
this . redis_client = options . redis_client ;
29
29
this . key = options . key ? 'limit:' + options . key : 'limit:' ;
30
30
this . limit = options . limit || 10 ;
47
47
* }
48
48
* @param callback {function(Object, Object=)} - finish callback
49
49
*/
50
- R3Limiter . prototype . get = function ( callback ) {
50
+ Limiter . prototype . get = function ( callback ) {
51
51
52
52
var _this = this ;
53
53
this . _executeFunction ( callback ) ;
62
62
* err: error
63
63
* @param callback {function(Object=)} - finish callback
64
64
*/
65
- R3Limiter . prototype . run = function ( callback ) {
65
+ Limiter . prototype . run = function ( callback ) {
66
66
var _this = this ;
67
67
this . get ( function ( err , result ) {
68
68
if ( err || ! result ) {
84
84
* @param callback
85
85
* @private
86
86
*/
87
- R3Limiter . prototype . _executeFunction = function ( callback ) {
87
+ Limiter . prototype . _executeFunction = function ( callback ) {
88
88
89
89
var _this = this ;
90
90
109
109
} ) ;
110
110
} ;
111
111
112
- module . exports = R3Limiter ;
112
+ module . exports = Limiter ;
113
113
} ) ( ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @aftership/rate-limiter" ,
3
3
"description" : " The Real Redis Rate Limiter for Node.js, accept ioredis client only for redis cluster" ,
4
- "version" : " 2.0.2 " ,
4
+ "version" : " 2.0.3 " ,
5
5
"homepage" : " https://github.com/AfterShip/rate-limiter" ,
6
6
"author" : {
7
7
"name" : " AfterShip" ,
You can’t perform that action at this time.
0 commit comments