{"id":16681672,"url":"https://github.com/julienxx/resque-waiting-room","last_synced_at":"2025-09-16T18:06:20.255Z","repository":{"id":2419500,"uuid":"3387930","full_name":"julienXX/resque-waiting-room","owner":"julienXX","description":"Resque plugin that throttles your jobs","archived":false,"fork":false,"pushed_at":"2018-02-07T09:18:32.000Z","size":57,"stargazers_count":33,"open_issues_count":1,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-13T14:11:32.252Z","etag":null,"topics":["rate-limiting","resque","resque-plugin","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julienXX.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-08T14:31:03.000Z","updated_at":"2024-08-25T18:42:59.000Z","dependencies_parsed_at":"2022-08-18T05:25:32.694Z","dependency_job_id":null,"html_url":"https://github.com/julienXX/resque-waiting-room","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienXX%2Fresque-waiting-room","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienXX%2Fresque-waiting-room/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienXX%2Fresque-waiting-room/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julienXX%2Fresque-waiting-room/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julienXX","download_url":"https://codeload.github.com/julienXX/resque-waiting-room/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669381,"owners_count":16860861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rate-limiting","resque","resque-plugin","ruby"],"created_at":"2024-10-12T14:04:58.712Z","updated_at":"2025-09-16T18:06:15.181Z","avatar_url":"https://github.com/julienXX.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Resque Waiting Room\n===================\n\nA [Resque][rq] plugin. Requires Resque \u003e= 1.19 and a \u003e= 1.9 Ruby (MRI, JRuby or Rubinius).\n\nIf you want to limit the number of performs of a job for a given period, extend it\nwith this module.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'resque-waiting-room'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install resque-waiting-room\n\n## Usage\n\n#### Example -- 10 jobs processed every 30 seconds max\n\n    require 'resque/plugins/waiting_room'\n\n    class UpdateDataFromExternalAPI\n      extend Resque::Plugins::WaitingRoom\n\n      # This job can be performed 10 times every 30 seconds\n      can_be_performed times: 10, period: 30\n\n      def self.perform(repo_id)\n        blah\n      end\n    end\n\nIf 10 UpdateDataFromExternalAPI jobs have been performed in 20\nseconds, for the next 10 seconds UpdateDataFromExternalAPI jobs\nwill be placed in the waiting_room queue and processed when possible.\nWhen the first 30 seconds are elapsed, the counter is set back to 0\nand 10 jobs can be performed again.\nYou got to manually tweak the queue names in your workers though.\n\n## Testing\n\nWe include a matcher\n\n    require 'spec/support/matchers'\n\n    describe MyJob do\n      it 'is rate limited' do\n        MyJob.should be_only_performed(times: 100, period: 300)\n      end\n    end\n\nRun tests with the following command\n\n    bundle exec rake\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Thanks to the following people for helping out ##\n\n- Thomas Devol [@socialchorus](https://github.com/socialchorus) for adding the RSpec matcher\n- Max Dunn [@maxdunn210](https://github.com/maxdunn210) for making me switch Resque 2 specific code in it's own branch\n- Jeff Durand [@johnnyiller](https://github.com/johnnyiller) for the update of has_remaining_performs_key using the latest form set and the fix for a rare ttl bug\n- Tatsuya Takamura [@ttakamura](https://github.com/ttakamura) for raising the issue on the rare ttl bug\n- Omry Zobel [@omryYotpo](https://github.com/omryYotpo) for allowing some customization of the redis key\n\n[rq]: http://github.com/resque/resque\n\n[![Build Status](https://travis-ci.org/julienXX/resque-waiting-room.png)](https://travis-ci.org/julienXX/resque-waiting-room) [![Code Climate](https://codeclimate.com/github/julienXX/resque-waiting-room.png)](https://codeclimate.com/github/julienXX/resque-waiting-room)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulienxx%2Fresque-waiting-room","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulienxx%2Fresque-waiting-room","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulienxx%2Fresque-waiting-room/lists"}