https://github.com/youpy/proc-throttle
Proc#throttle: throttling calls
https://github.com/youpy/proc-throttle
Last synced: 10 months ago
JSON representation
Proc#throttle: throttling calls
- Host: GitHub
- URL: https://github.com/youpy/proc-throttle
- Owner: youpy
- License: mit
- Created: 2012-05-24T01:56:17.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2015-10-30T01:46:22.000Z (over 10 years ago)
- Last Synced: 2023-04-10T11:22:14.497Z (about 3 years ago)
- Language: Ruby
- Size: 137 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# proc-throttle [](http://travis-ci.org/youpy/proc-throttle)
Proc#throttle: throttling calls
## Installation
Add this line to your application's Gemfile:
gem 'proc-throttle'
And then execute:
$ bundle
Or install it yourself as:
$ gem install proc-throttle
## Usage
count = 0
proc = Proc.new do
count += 1
end.throttle(1)
10.times do
proc.call
end
count // => 1
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request