File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 )
42
53The Real Redis Rate Limiter for Node.js
64
Original file line number Diff line number Diff line change 11/*
2- * r3limiter
2+ * Limiter
33 * https://github.com/AfterShip/r3limiter
44 *
55 * Copyright (c) 2015 AfterShip
1212 var fs = require ( 'fs' ) ;
1313
1414 /**
15- * R3Limiter constructor
15+ * Limiter constructor
1616 * options:
1717 * {
1818 * redis_client: redis connection client instance
2424 * @param options {Object} - option parameters
2525 * @constructor
2626 */
27- function R3Limiter ( options ) {
27+ function Limiter ( options ) {
2828 this . redis_client = options . redis_client ;
2929 this . key = options . key ? 'limit:' + options . key : 'limit:' ;
3030 this . limit = options . limit || 10 ;
4747 * }
4848 * @param callback {function(Object, Object=)} - finish callback
4949 */
50- R3Limiter . prototype . get = function ( callback ) {
50+ Limiter . prototype . get = function ( callback ) {
5151
5252 var _this = this ;
5353 this . _executeFunction ( callback ) ;
6262 * err: error
6363 * @param callback {function(Object=)} - finish callback
6464 */
65- R3Limiter . prototype . run = function ( callback ) {
65+ Limiter . prototype . run = function ( callback ) {
6666 var _this = this ;
6767 this . get ( function ( err , result ) {
6868 if ( err || ! result ) {
8484 * @param callback
8585 * @private
8686 */
87- R3Limiter . prototype . _executeFunction = function ( callback ) {
87+ Limiter . prototype . _executeFunction = function ( callback ) {
8888
8989 var _this = this ;
9090
109109 } ) ;
110110 } ;
111111
112- module . exports = R3Limiter ;
112+ module . exports = Limiter ;
113113} ) ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @aftership/rate-limiter" ,
33 "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 " ,
55 "homepage" : " https://github.com/AfterShip/rate-limiter" ,
66 "author" : {
77 "name" : " AfterShip" ,
You can’t perform that action at this time.
0 commit comments