throttled_object is a Ruby 1.9 library built on top of ruby to provide throttled access
to a given object. It provides an interface to interact with an object, either sleeping or raising
an exception when it's not available.
The ideal use for this is for access to APIs with a blocking interface (e.g. Run the code in a thread, sleep until it's available).
PLEASE NOTE: I don't yet consider this production worthy. There are still bugs in the locking algorithm that need to be worked out for it work efficiently. This will be done in the near future.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install throttled_object
TODO: Add here.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
throttled_object is released under the MIT License (see the license file) and is copyright Filter Squad, 2012.