hirefire-resource 0.10.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +171 -0
  3. data/LICENSE +21 -66
  4. data/README.md +34 -78
  5. data/hirefire-resource.gemspec +21 -15
  6. data/lib/hirefire/configuration.rb +31 -0
  7. data/lib/hirefire/errors/job_queue_latency_unsupported.rb +12 -0
  8. data/lib/hirefire/errors.rb +9 -0
  9. data/lib/hirefire/hirefire.rb +15 -0
  10. data/lib/hirefire/macro/bunny.rb +55 -55
  11. data/lib/hirefire/macro/delayed_job.rb +80 -60
  12. data/lib/hirefire/macro/deprecated/bunny.rb +85 -0
  13. data/lib/hirefire/macro/deprecated/delayed_job.rb +62 -0
  14. data/lib/hirefire/macro/deprecated/good_job.rb +32 -0
  15. data/lib/hirefire/macro/deprecated/que.rb +76 -0
  16. data/lib/hirefire/macro/deprecated/queue_classic.rb +28 -0
  17. data/lib/hirefire/macro/deprecated/resque.rb +47 -0
  18. data/lib/hirefire/macro/deprecated/sidekiq.rb +138 -0
  19. data/lib/hirefire/macro/good_job.rb +48 -13
  20. data/lib/hirefire/macro/que.rb +56 -36
  21. data/lib/hirefire/macro/queue_classic.rb +86 -0
  22. data/lib/hirefire/macro/resque.rb +111 -25
  23. data/lib/hirefire/macro/sidekiq.rb +324 -74
  24. data/lib/hirefire/macro/solid_queue.rb +166 -0
  25. data/lib/hirefire/middleware.rb +50 -103
  26. data/lib/hirefire/railtie.rb +1 -1
  27. data/lib/hirefire/resource.rb +1 -47
  28. data/lib/hirefire/utility.rb +22 -0
  29. data/lib/hirefire/version.rb +5 -0
  30. data/lib/hirefire/web.rb +151 -0
  31. data/lib/hirefire/worker.rb +39 -0
  32. data/lib/hirefire-resource.rb +4 -9
  33. metadata +50 -25
  34. data/.github/workflows/main.yml +0 -16
  35. data/.gitignore +0 -5
  36. data/Gemfile +0 -10
  37. data/Gemfile.lock +0 -52
  38. data/Rakefile +0 -4
  39. data/bin/rake +0 -29
  40. data/lib/hirefire/macro/qc.rb +0 -23
  41. data/lib/hirefire/macro/qu.rb +0 -27
data/Gemfile.lock DELETED
@@ -1,52 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- hirefire-resource (0.10.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.2)
10
- json (2.6.2)
11
- parallel (1.22.1)
12
- parser (3.1.2.1)
13
- ast (~> 2.4.1)
14
- rainbow (3.1.1)
15
- rake (13.0.6)
16
- regexp_parser (2.6.0)
17
- rexml (3.2.5)
18
- rubocop (1.35.1)
19
- json (~> 2.3)
20
- parallel (~> 1.10)
21
- parser (>= 3.1.2.1)
22
- rainbow (>= 2.2.2, < 4.0)
23
- regexp_parser (>= 1.8, < 3.0)
24
- rexml (>= 3.2.5, < 4.0)
25
- rubocop-ast (>= 1.20.1, < 2.0)
26
- ruby-progressbar (~> 1.7)
27
- unicode-display_width (>= 1.4.0, < 3.0)
28
- rubocop-ast (1.22.0)
29
- parser (>= 3.1.1.0)
30
- rubocop-performance (1.14.3)
31
- rubocop (>= 1.7.0, < 2.0)
32
- rubocop-ast (>= 0.4.0)
33
- ruby-progressbar (1.11.0)
34
- standard (1.16.1)
35
- rubocop (= 1.35.1)
36
- rubocop-performance (= 1.14.3)
37
- standardrb (1.0.1)
38
- standard
39
- unicode-display_width (2.3.0)
40
-
41
- PLATFORMS
42
- arm64-darwin-21
43
- x86_64-darwin-20
44
- x86_64-linux
45
-
46
- DEPENDENCIES
47
- hirefire-resource!
48
- rake
49
- standardrb
50
-
51
- BUNDLED WITH
52
- 2.2.24
data/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "standard/rake"
data/bin/rake DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rake' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("rake", "rake")
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module HireFire
4
- module Macro
5
- module QC
6
- extend self
7
-
8
- # Queries the PostgreSQL database through QueueClassic in order to
9
- # count the amount of jobs in the specified queue.
10
- #
11
- # @example QueueClassic Macro Usage
12
- # HireFire::Macro::QC.queue # counts the `default` queue.
13
- # HireFire::Macro::QC.queue("email") # counts the `email` queue.
14
- #
15
- # @param [String, Symbol, nil] queue the queue name to count. (default: `default`)
16
- # @return [Integer] the number of jobs in the queue(s).
17
- #
18
- def queue(queue = "default")
19
- ::QC::Queue.new(queue).count
20
- end
21
- end
22
- end
23
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module HireFire
4
- module Macro
5
- module Qu
6
- extend self
7
-
8
- # Counts the amount of jobs in the (provided) Qu queue(s).
9
- #
10
- # @example Qu Macro Usage
11
- # HireFire::Macro::Qu.queue # all queues
12
- # HireFire::Macro::Qu.queue("email") # only email queue
13
- # HireFire::Macro::Qu.queue("audio", "video") # audio and video queues
14
- #
15
- # @param [Array] queues provide one or more queue names, or none for "all".
16
- # @return [Integer] the number of jobs in the queue(s).
17
- #
18
- def queue(*queues)
19
- queues = ::Qu.backend.queues if queues.empty?
20
- queues.flatten.inject(0) { |memo, queue|
21
- memo += ::Qu.backend.length(queue)
22
- memo
23
- }
24
- end
25
- end
26
- end
27
- end