hirefire-resource 0.7.5 → 0.8.0

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
  SHA256:
3
- metadata.gz: 2c7c314af60ca51b3e19880d4f676a5e07ecb5625d8078b7200827a9b2c9338b
4
- data.tar.gz: 486392f48c5986bdf100c03a2047496a840c788ffc2af2e27712d41ce6c6cc0b
3
+ metadata.gz: bf1b333fe0b454c20c681c25fcc71f0f848f241421ceedde11e30ba5f29a467f
4
+ data.tar.gz: 76cd10b7c38c130405db1988267cb861c9b0a4ca69a38b8e30404dbc92d576f1
5
5
  SHA512:
6
- metadata.gz: c10d31c05160fcd258c804e9e7e1ca9d4e608d71ef0a579255f03cac37c2f50b5a81e4c8ea9c24abf57179c3e0e86c5616a0855cee52561eb793d2957608edd2
7
- data.tar.gz: b44fd34a1ec5395d2734745e1f72b6a189f37aa285d67177e19764619de1c4770d6a6f40d133cc02e6e3285cc781761df03b9cfb63916974731d2de02325d023
6
+ metadata.gz: cab33d00cef820b5f895638e5b905c2ae30fcda10de6d890a168bfa4635643fdb6a2a074ebe1863476d8086c8615974dc0123e0b890e4dd147aea2c135107db7
7
+ data.tar.gz: df331cea509df6b7c1f58c8d65471479157dd4ce43179d5150b9cfe61144d2d9f1dd7da50cdd455ad28245dafbe748b671a1af72cdccf85846ce304ee25657d7
@@ -1,4 +1,8 @@
1
- ## v0.7.5/Master
1
+ ## v0.8.0/Master
2
+
3
+ * Add GoodJob macro for `good_job` adapter. https://github.com/bensheldon/good_job
4
+
5
+ ## v0.7.5
2
6
 
3
7
  * Fix compatibility issue with Que 1.x (backwards-compatible with Que 0.x).
4
8
 
data/README.md CHANGED
@@ -6,13 +6,14 @@ Load-based scaling, schedule-based scaling, dyno crash recovery, for [Heroku](ht
6
6
 
7
7
  It supports practically any worker library. We provide out-of-the-box support for:
8
8
 
9
+ * Sidekiq
9
10
  * Delayed Job
10
11
  * Resque
12
+ * GoodJob
11
13
  * Qu
14
+ * Que
12
15
  * QueueClassic
13
- * Sidekiq
14
16
  * Bunny
15
- * Que
16
17
 
17
18
  *Note that you can write your own worker queue logic for almost any other worker library as well.
18
19
  HireFire can scale multiple individual worker libraries at the same time, as well as multiple individual queues for any worker library.*
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "hirefire-resource"
5
- gem.version = "0.7.5"
5
+ gem.version = "0.8.0"
6
6
  gem.platform = Gem::Platform::RUBY
7
7
  gem.authors = "Michael van Rooijen"
8
8
  gem.email = "michael@hirefire.io"
@@ -6,9 +6,8 @@ HIREFIRE_PATH = File.expand_path("../hirefire", __FILE__)
6
6
  require "#{HIREFIRE_PATH}/#{file}"
7
7
  end
8
8
 
9
- %w[delayed_job resque sidekiq qu qc bunny que].each do |file|
9
+ %w[delayed_job resque sidekiq qu qc bunny que good_job].each do |file|
10
10
  require "#{HIREFIRE_PATH}/macro/#{file}"
11
11
  end
12
12
 
13
13
  require "#{HIREFIRE_PATH}/railtie" if defined?(Rails::Railtie)
14
-
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ module HireFire
4
+ module Macro
5
+ module GoodJob
6
+ extend self
7
+
8
+ # Queries the PostgreSQL database through GoodJob in order to
9
+ # count the amount of jobs in the specified queue.
10
+ #
11
+ # @example Queue Macro Usage
12
+ # HireFire::Macro::GoodJob.queue # counts all queues.
13
+ # HireFire::Macro::GoodJob.queue("email") # counts the `email` queue.
14
+ #
15
+ # @param [String] queue the queue name to count. (default: nil # gets all queues)
16
+ # @return [Integer] the number of jobs in the queue(s).
17
+ #
18
+ def queue(*queues)
19
+ scope = ::GoodJob::Job.only_scheduled
20
+ scope = scope.where(queue_name: queues) if queues.any?
21
+ scope.count
22
+ end
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hirefire-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van Rooijen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-30 00:00:00.000000000 Z
11
+ date: 2020-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Load- and schedule-based scaling for web- and worker dynos
14
14
  email: michael@hirefire.io
@@ -30,6 +30,7 @@ files:
30
30
  - lib/hirefire/cli.rb
31
31
  - lib/hirefire/macro/bunny.rb
32
32
  - lib/hirefire/macro/delayed_job.rb
33
+ - lib/hirefire/macro/good_job.rb
33
34
  - lib/hirefire/macro/qc.rb
34
35
  - lib/hirefire/macro/qu.rb
35
36
  - lib/hirefire/macro/que.rb