good_job 0.4.0 → 0.5.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: 5a3b5327b3b95b67901f3be13858f0bbf9cf1d0818793ed653f084a77b8e6ff9
4
- data.tar.gz: 056fd886d26d7ee60fd63d7f45714c7b843f7f4e6661b58a00dc4c6ec17d9b9c
3
+ metadata.gz: c11065689d3442c14ab8afb08ad17a96c45414287e9c24440d26be766eff3566
4
+ data.tar.gz: 316168ca2ecf9aa9a239d007b85b589c34ec68064ad3ec376665bb893aceae4c
5
5
  SHA512:
6
- metadata.gz: 12221043ad332a684e062aae176d529bbd39da7998e9ae6d355bdb1f68f2f7ace21c4f4196ebe0306841a761161e564125f35c7522f30f3b2f718830bd15c788
7
- data.tar.gz: 7d389ac1aafb614b813fdb1eb75ce7dceba40238111966d8031578ac88553d989cee08dcef03d72fd8e53ce3215692779e2e03c538ea90cb3a477361ef2442d8
6
+ metadata.gz: 9cb0b54f3e2a7189684fb5f3ea98ea4febd6e1651ff7f9f47b78be19e9a4948c731c9e990e89921b3763236a33cbf45905d8c05c417d5044caaf844b67600510
7
+ data.tar.gz: 8f45cc0b5ccd1c61c3e55ac748359156d3f4081646537b327476bd964e15e45e6a953c01ae0f237b0c08fd7bcbd3bd94bf9d7bb484c45d26600790f7870b9ccf
@@ -1,8 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## [0.4.0](https://github.com/bensheldon/good_job/tree/0.4.0) (2020-03-30)
3
+ ## [0.5.0](https://github.com/bensheldon/good_job/tree/0.5.0) (2020-07-13)
4
4
 
5
- [Full Changelog](https://github.com/bensheldon/good_job/compare/v0.3.0...0.4.0)
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v0.4.0...0.5.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Update development Ruby to 2.6.6 and gems [\#29](https://github.com/bensheldon/good_job/pull/29) ([bensheldon](https://github.com/bensheldon))
10
+ - Allow configuration of Rails queue adapter with `:good\_job` [\#28](https://github.com/bensheldon/good_job/pull/28) ([bensheldon](https://github.com/bensheldon))
11
+
12
+ ## [v0.4.0](https://github.com/bensheldon/good_job/tree/v0.4.0) (2020-03-31)
13
+
14
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v0.3.0...v0.4.0)
6
15
 
7
16
  **Merged pull requests:**
8
17
 
@@ -18,6 +27,7 @@
18
27
  - Update development Ruby to 2.6.5 [\#22](https://github.com/bensheldon/good_job/pull/22) ([bensheldon](https://github.com/bensheldon))
19
28
  - Simplify the internal API, removing JobWrapper and InlineScheduler [\#21](https://github.com/bensheldon/good_job/pull/21) ([bensheldon](https://github.com/bensheldon))
20
29
  - Generate a new future for every executed job [\#20](https://github.com/bensheldon/good_job/pull/20) ([bensheldon](https://github.com/bensheldon))
30
+ - Configuration for maximum number of job execution threads [\#18](https://github.com/bensheldon/good_job/pull/18) ([bensheldon](https://github.com/bensheldon))
21
31
 
22
32
  ## [v0.2.2](https://github.com/bensheldon/good_job/tree/v0.2.2) (2020-03-08)
23
33
 
@@ -25,7 +35,6 @@
25
35
 
26
36
  **Merged pull requests:**
27
37
 
28
- - Configuration for maximum number of job execution threads [\#18](https://github.com/bensheldon/good_job/pull/18) ([bensheldon](https://github.com/bensheldon))
29
38
  - Gracefully shutdown Scheduler when executable receives TERM or INT [\#17](https://github.com/bensheldon/good_job/pull/17) ([bensheldon](https://github.com/bensheldon))
30
39
  - Update Appraisals [\#16](https://github.com/bensheldon/good_job/pull/16) ([bensheldon](https://github.com/bensheldon))
31
40
 
@@ -37,7 +46,6 @@
37
46
 
38
47
  - Clean up Gemspec [\#15](https://github.com/bensheldon/good_job/pull/15) ([bensheldon](https://github.com/bensheldon))
39
48
  - Set up Rubocop [\#14](https://github.com/bensheldon/good_job/pull/14) ([bensheldon](https://github.com/bensheldon))
40
- - Add pg gem as explicit dependency [\#13](https://github.com/bensheldon/good_job/pull/13) ([bensheldon](https://github.com/bensheldon))
41
49
  - Bump nokogiri from 1.10.7 to 1.10.9 [\#12](https://github.com/bensheldon/good_job/pull/12) ([dependabot[bot]](https://github.com/apps/dependabot))
42
50
  - Add Appraisal with tests for Rails 5.1, 5.2, 6.0 [\#11](https://github.com/bensheldon/good_job/pull/11) ([bensheldon](https://github.com/bensheldon))
43
51
 
@@ -47,6 +55,7 @@
47
55
 
48
56
  **Merged pull requests:**
49
57
 
58
+ - Add pg gem as explicit dependency [\#13](https://github.com/bensheldon/good_job/pull/13) ([bensheldon](https://github.com/bensheldon))
50
59
  - Use Rails.logger and ActiveSupport::Notifications for logging instead of puts [\#10](https://github.com/bensheldon/good_job/pull/10) ([bensheldon](https://github.com/bensheldon))
51
60
  - Remove minitest files [\#9](https://github.com/bensheldon/good_job/pull/9) ([bensheldon](https://github.com/bensheldon))
52
61
  - Use scheduled\_at and priority for scheduling [\#8](https://github.com/bensheldon/good_job/pull/8) ([bensheldon](https://github.com/bensheldon))
data/README.md CHANGED
@@ -14,12 +14,12 @@ Inspired by [Delayed::Job](https://github.com/collectiveidea/delayed_job) and [Q
14
14
  Add this line to your application's Gemfile:
15
15
 
16
16
  ```ruby
17
- gem 'good_job', github: 'bensheldon/good_job'
17
+ gem 'good_job'
18
18
  ```
19
19
 
20
20
  And then execute:
21
21
  ```bash
22
- $ bundle
22
+ $ bundle install
23
23
  ```
24
24
 
25
25
  ## Usage
@@ -56,11 +56,21 @@ $ bundle
56
56
 
57
57
  1. Configure the ActiveJob adapter:
58
58
  ```ruby
59
- # config/environments/production.rb
60
- config.active_job.queue_adapter = GoodJob::Adapter.new
61
-
59
+ # config/application.rb
60
+ config.active_job.queue_adapter = :good_job
61
+ ```
62
+
63
+ By default, using `:good_job` is equivalent to manually configuring the adapter:
64
+
65
+ ```ruby
62
66
  # config/environments/development.rb
63
67
  config.active_job.queue_adapter = GoodJob::Adapter.new(inline: true)
68
+
69
+ # config/environments/test.rb
70
+ config.active_job.queue_adapter = GoodJob::Adapter.new(inline: true)
71
+
72
+ # config/environments/production.rb
73
+ config.active_job.queue_adapter = GoodJob::Adapter.new
64
74
  ```
65
75
 
66
76
  1. In production, the scheduler is designed to run in its own process:
@@ -94,6 +104,17 @@ $ bin/setup_test
94
104
  $ bin/rspec
95
105
  ```
96
106
 
107
+ This gem uses Appraisal to run tests against multiple versions of Rails:
108
+
109
+ ```bash
110
+ # Install Appraisal(s) gemfiles
111
+ $ bundle exec appraisal
112
+
113
+ # Run tests
114
+ $ bundle exec appraisal bin/rspec
115
+
116
+ ```
117
+
97
118
  For developing locally within another Ruby on Rails project:
98
119
 
99
120
  ```bash
@@ -0,0 +1,13 @@
1
+ module ActiveJob
2
+ module QueueAdapters
3
+ class GoodJobAdapter < GoodJob::Adapter
4
+ def initialize
5
+ if Rails.env.development? || Rails.env.test?
6
+ super(inline: true)
7
+ else
8
+ super(inline: false)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -8,6 +8,8 @@ require "good_job/scheduler"
8
8
  require 'good_job/adapter'
9
9
  require 'good_job/pg_locks'
10
10
 
11
+ require 'active_job/queue_adapters/good_job_adapter'
12
+
11
13
  module GoodJob
12
14
  include Logging
13
15
 
@@ -27,8 +27,6 @@ module GoodJob
27
27
  nil
28
28
  end
29
29
 
30
- private
31
-
32
30
  def inline?
33
31
  @inline
34
32
  end
@@ -1,3 +1,3 @@
1
1
  module GoodJob
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -207,6 +207,7 @@ files:
207
207
  - LICENSE.txt
208
208
  - README.md
209
209
  - exe/good_job
210
+ - lib/active_job/queue_adapters/good_job_adapter.rb
210
211
  - lib/good_job.rb
211
212
  - lib/good_job/adapter.rb
212
213
  - lib/good_job/cli.rb