sidekiq-dynamic-throttle 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b7fbc2235c707b7b851a12b9e03bf1b3db1cbaa
4
- data.tar.gz: 080520421f62a90964903da61665b75e5b72c3ac
3
+ metadata.gz: 6e6b2133bce30fa72f42ff1da1ed1cd411133ecd
4
+ data.tar.gz: 527f40097dd9d5efa61ce788fdc1cdfac5d546be
5
5
  SHA512:
6
- metadata.gz: e7e73a1a531249a84ab300f9e88d75f27b2c2b4c11b64ee954274bc80ffec007c1c384805440ff77de5e0378de1c7773380424d1943a564739ca95ffc74bbd2e
7
- data.tar.gz: 61216980ba1bb3de1e4c640f063e3252888da87c17dbb554cef53220f14498d871550861ebdb8e4b42a9de7d6da270f24bcee6fe28794cfe16d91f96ea29ca26
6
+ metadata.gz: 7d6267cf3a02690234c246371b5164dbece349eb8f83bb7d20cd4903801976b4be09635c0e7adc202dcedbc1c444ae3fd5cfcd604d6f937425ba86a9d1647577
7
+ data.tar.gz: 65ed36c1ca23a384e22043917b5abcc7aee79fdb7e27a9cffbdd26c4ccc3382504656d22e65ebc215103e4af833f7bc169de9500e19d1691404c0ca54813731e
data/CHANGELOG.md CHANGED
@@ -1,11 +1,7 @@
1
- ## 0.1.0 (May 30, 2014)
1
+ ## 0.1.1 (Jan 8, 2015)
2
2
 
3
- * Support callables for all configuration options
3
+ * [bobbrez] Add module for convience adding throttles
4
4
 
5
- *Kevin Yank*
5
+ ## 0.1.0 (Jan 8, 2015)
6
6
 
7
- ## 0.0.1 (December 3, 2013)
8
-
9
- * Initial release.
10
-
11
- *Blake Thomas*
7
+ * [bobbrez] Initial project setup including queue throttling base on throttles
@@ -0,0 +1,11 @@
1
+ module Sidekiq::DynamicThrottle::Throttler
2
+ module ClassMethods
3
+ def sidekiq_throttle_queue(*queues)
4
+ Sidekiq::DynamicThrottle.register_throttle self, queues
5
+ end
6
+ end
7
+
8
+ def self.included(base)
9
+ base.extend ClassMethods
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module DynamicThrottle
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -3,13 +3,15 @@ require 'sidekiq/fetch'
3
3
 
4
4
  require 'sidekiq-dynamic-throttle/version'
5
5
  require 'sidekiq-dynamic-throttle/fetch'
6
+ require 'sidekiq-dynamic-throttle/throttler'
6
7
 
7
8
  module Sidekiq::DynamicThrottle
8
9
  def self.throttles
9
10
  @throttles ||= Hash.new { |hash, key| hash[key] = [] }
10
11
  end
11
12
 
12
- def self.register_throttle(queue, throttle)
13
- throttles['queue:' + queue.to_s] << throttle
13
+ def self.register_throttle(throttle, *queues)
14
+ queues.flatten!
15
+ queues.each { |queue| throttles['queue:' + queue.to_s] << throttle }
14
16
  end
15
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-dynamic-throttle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Breznak
@@ -136,6 +136,7 @@ files:
136
136
  - lib/sidekiq-dynamic-throttle.rb
137
137
  - lib/sidekiq-dynamic-throttle/fetch.rb
138
138
  - lib/sidekiq-dynamic-throttle/server.rb
139
+ - lib/sidekiq-dynamic-throttle/throttler.rb
139
140
  - lib/sidekiq-dynamic-throttle/version.rb
140
141
  - sidekiq-dynamic-throttle.gemspec
141
142
  - spec/sidekiq-rate-limiter/fetch_spec.rb