cuetip 2.0.0 → 2.0.1

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: 6c55fc81c458fe59398107580afc01e293ad447e04627345adf0fce1a65bb58d
4
- data.tar.gz: 05a2f8814e4f40d6e665d19015cb3dd24b371c5ea9371a47d5e37a47f3ef7ff0
3
+ metadata.gz: 846dd406c3144f1548c2385b57854e02fc58a28c198557fbac1e5525390c4851
4
+ data.tar.gz: 4ccc211f14f69ebe8828ef6089bc5a4179672cdff7e8c91bf1199f30c9ab7893
5
5
  SHA512:
6
- metadata.gz: ff6e9e82ea4f10c7e1980eabb0b24cf234c76aea8ec310d494ab258844abbd7c1fecfec5db0953a38634bfcdecf3f4ffd64f31c900ff0b39db367535177b42f6
7
- data.tar.gz: 349d426cda2a0b3651ad61cb93d66b4db07ebcf32941ac852f1b069001d7d80a78d9f73fb7e79fafe5996ba42833efdfcf2cb5c105950e3e0f3bca31eb13220d
6
+ metadata.gz: 21def25a628be5d6698b8254093acc612fa68dc549a674e0b495f9c91dfcc82bb2d1bfa2a863830caf3009c8d41fd35724f66f1ec10a6c2a75d15a31688053f5
7
+ data.tar.gz: 073ad3cfca0e29f854df84bffbba65120302aa29ad6a2e3d0c258fa8c24ef648764e808f25e4bce9693a63016a8062a16c578606e40073b79df4283aba95af63
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cuetip
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -6,6 +6,7 @@ module Cuetip
6
6
  class WorkerGroup
7
7
  include ActiveSupport::Callbacks
8
8
 
9
+ define_callbacks :run_worker_group
9
10
  define_callbacks :run_worker
10
11
 
11
12
  attr_reader :quantity
@@ -34,19 +35,21 @@ module Cuetip
34
35
  trap('INT', &exit_trap)
35
36
  trap('TERM', &exit_trap)
36
37
 
37
- @quantity.times do |i|
38
- @workers[i] = Worker.new(self, i, @queues)
39
- Klogger.tagged worker_index: i do
40
- Cuetip.logger.info "Starting worker"
41
- @threads[i] = Thread.new(@workers[i]) do |worker|
42
- run_callbacks :run_worker do
43
- worker.run
38
+ run_callbacks :run_worker_group do
39
+ @quantity.times do |i|
40
+ @workers[i] = Worker.new(self, i, @queues)
41
+ Klogger.tagged worker_index: i do
42
+ Cuetip.logger.info "Starting worker"
43
+ @threads[i] = Thread.new(@workers[i]) do |worker|
44
+ run_callbacks :run_worker do
45
+ worker.run
46
+ end
44
47
  end
45
48
  end
49
+ @threads[i].abort_on_exception = true
46
50
  end
47
- @threads[i].abort_on_exception = true
51
+ @threads.values.each(&:join)
48
52
  end
49
- @threads.values.each(&:join)
50
53
  end
51
54
  end
52
55
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuetip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-10 00:00:00.000000000 Z
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.2.32
104
+ rubygems_version: 3.4.6
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: An ActiveRecord job queueing system