sidekiq-throttler 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0258db1754f26622f1f38b1875774946a6a1c16e
4
- data.tar.gz: 151f57ccb677fd3ad6cd25cd30ed605da04acb97
3
+ metadata.gz: 1a48a69a956224bcd3ea8fae08c21210e44f9aee
4
+ data.tar.gz: 0f9146f8756e701ae3d1eb0beef9654dd0074c56
5
5
  SHA512:
6
- metadata.gz: 91440b76579924fc449a60c749ce5b88619c5efacfa5fabc45271b7f3f6a72b7408bc2b9b954e99d5aa33ab0b52a18addc957c9753fe4854b521c82738aec389
7
- data.tar.gz: 9b57fbf2ae12af64aaf5667d658da9e2fb6af6ba3099373376eedad86c422a13a879a80137f7f9c8d2244dcb91a7db18bbb01555d43c6a57b37f2af999d5ece5
6
+ metadata.gz: 4608ce6e67d51e53626a8d63fbf9d06e462fc502d01cce70eb1997d726a285ec65406cc0d8aa5a59abf375ec153d76d983d4af03a6b4e138959305f66ea61bdb
7
+ data.tar.gz: bb21a8d354dc7f609beb4e65886479d0688101407087b2b8b45038257f59c178719e91255f8999eff1eeee11b0a08c8bf4875f79e7382bdf0f108622e251f230
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.1 (November 5, 2013)
2
+
3
+ * `Singleton` is explicitly required, fixing a `NameError`.
4
+
5
+ *Bruno Pinto*
6
+
1
7
  ## 0.3.0 (October 3, 2013)
2
8
 
3
9
  * Redis is supported as a storage backend for persistence of job execution
data/README.md CHANGED
@@ -72,7 +72,7 @@ If throttling is per-user, for example, you can specify a `Proc` for `key` which
72
72
  accepts the arguments passed to your worker's `perform` method:
73
73
 
74
74
  ```ruby
75
- sidekiq_options throttle: { threshold: 20, period: 1.day, key: ->{ |user_id| user_id } }
75
+ sidekiq_options throttle: { threshold: 20, period: 1.day, key: ->(user_id){ user_id } }
76
76
  ```
77
77
 
78
78
  In the above example, jobs are throttled for each user when they exceed 20 in a
@@ -82,7 +82,7 @@ Thresholds can be configured based on the arguments passed to your worker's `per
82
82
  similar to how the `key` option works:
83
83
 
84
84
  ```ruby
85
- sidekiq_options throttle: { threshold: -> {|user_id, rate_limit| rate_limit }, period: 1.hour, key: ->{ |user_id, rate_limit| user_id } }
85
+ sidekiq_options throttle: { threshold: ->(user_id, rate_limit) { rate_limit }, period: 1.hour, key: ->(user_id, rate_limit){ user_id } }
86
86
  ```
87
87
 
88
88
  In the above example, jobs are throttled for each user when they exceed the rate limit provided in the message. This is useful in cases where each user may have a different rate limit (ex: interacting with external APIs)
@@ -1,5 +1,6 @@
1
1
  require 'sidekiq'
2
2
  require 'active_support/core_ext/numeric/time'
3
+ require 'singleton'
3
4
 
4
5
  require 'sidekiq/throttler/version'
5
6
  require 'sidekiq/throttler/rate_limit'
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  class Throttler
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.description = %q{Sidekiq middleware that adds the ability to rate limit job execution.}
12
12
  gem.summary = %q{Sidekiq::Throttler is a middleware for Sidekiq that adds the ability to rate limit job execution on a per-worker basis.}
13
13
  gem.homepage = 'https://github.com/gevans/sidekiq-throttler'
14
+ gem.license = 'MIT'
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-throttler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-03 00:00:00.000000000 Z
11
+ date: 2013-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -290,7 +290,8 @@ files:
290
290
  - spec/spec_helper.rb
291
291
  - spec/support/sidekiq.rb
292
292
  homepage: https://github.com/gevans/sidekiq-throttler
293
- licenses: []
293
+ licenses:
294
+ - MIT
294
295
  metadata: {}
295
296
  post_install_message:
296
297
  rdoc_options: []