background_job 0.0.1.rc1 → 0.0.1.rc2

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: 7073c14e1fd364a96f5f4ddc812c5d67921905307af97f85bc3d8a0173304093
4
- data.tar.gz: 95f18748a479ffa52bf39ac94830080564a95223193c8655c59a36083b6eebc7
3
+ metadata.gz: 5ed529ee1ec4a0599d6d2f56fd65e51dd889117e104c586d6562b4b1c65b7e75
4
+ data.tar.gz: a39749d73db7546fe4fd39f28e703733c61fa4c207cd0155f94ef362540ea2f2
5
5
  SHA512:
6
- metadata.gz: aa43df351a913191022dc34d5773ec51ab80bfbdf575cad58c1d33845150fa75a443f3e394e00b46da3283f7e0e69a7ed86b4637ef6e2e960ff797021172758f
7
- data.tar.gz: c78f2257f401f3d9585f210007cb314da943aaa971dd396cccee703e142d1c949e1c037a8fcbb20bb3e8a623b7db0e36b6feb4fd25f1b42338669913465dfe4b
6
+ metadata.gz: e95ce61812f3e11f0b57dde326af88cd83d11b13fcad7b57883a118ef1707e5454df8021a27b162ec828077de2d25a6d71ddb8af9a32ce5d8af6c652138b8605
7
+ data.tar.gz: 2375fa6c0604919cd07507807abc91b6eca873f5b57cc072e4020fae6527957a7f2f1584e14883da77a35dc59d1a1cbe71cd01764e337f1f4f28884a028d719e
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- background_job (0.0.1.rc1)
5
- connection_pool
4
+ background_job (0.0.1.rc2)
6
5
  multi_json
7
6
  redis
8
7
 
@@ -34,6 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.require_paths = ['lib']
35
35
 
36
36
  spec.add_dependency 'redis', '>= 0.0.0'
37
- spec.add_dependency 'connection_pool', '>= 0.0.0'
38
37
  spec.add_dependency 'multi_json', '>= 0.0.0'
39
38
  end
@@ -16,6 +16,14 @@ module BackgroundJob
16
16
  class Configuration
17
17
  attr_reader :redis
18
18
 
19
+ def reset!
20
+ @redis = nil
21
+ @redis_pool = nil
22
+ @services = nil
23
+ @faktory = nil
24
+ @sidekiq = nil
25
+ end
26
+
19
27
  def redis=(value)
20
28
  @redis_pool = nil
21
29
  @redis = value
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BackgroundJob
4
- VERSION = '0.0.1.rc1'
4
+ VERSION = '0.0.1.rc2'
5
5
  end
@@ -42,9 +42,17 @@ module BackgroundJob
42
42
  faktory: 'Faktory',
43
43
  }.freeze
44
44
 
45
- SERVICES.each do |id, name|
46
- define_singleton_method(id) do |job_name, **options|
47
- Jobs.const_get(name).new(job_name, **options)
45
+ def self.job(service, job_name, **options)
46
+ service = service.to_sym
47
+ unless SERVICES.key?(service)
48
+ raise Error, "Service `#{service}' is not supported. Supported services are: #{SERVICES.keys.join(', ')}"
49
+ end
50
+ Jobs.const_get(SERVICES[service]).new(job_name, **options)
51
+ end
52
+
53
+ SERVICES.each do |service_name, _const_name|
54
+ define_singleton_method(service_name) do |job_name, **options|
55
+ job(service_name, job_name, **options)
48
56
  end
49
57
  end
50
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: background_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc1
4
+ version: 0.0.1.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos G. Zimmermann
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-14 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: connection_pool
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.0.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 0.0.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: multi_json
43
29
  requirement: !ruby/object:Gem::Requirement