jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.5k stars 132 forks source link

Allow sync method #19

Closed hongkongkiwi closed 9 years ago

hongkongkiwi commented 9 years ago

It would be great if callback could be ignored if it's undefined. Right now it throws an error.

For example, I want to removeTokens but I don't care about the callback. Perhaps you could add a removeTokensSync method? and in removeTokens just check if callback is not null and is a function.

hongkongkiwi commented 9 years ago

My bad, looks like there is infact a sync method tryRemoveTokens