workhorse 0.6.2 → 0.6.3

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: 62aa9ae4e08d8733741608e7c48f26c6fa7c405b4149d3af7d54439cb320bedb
4
- data.tar.gz: cc6190f4d61a16f015fab24b49a990329fe87262195a2fc6c5315a5b29a55bc7
3
+ metadata.gz: 42369906b8cebe1da36b01035d7a28e9a10af2b39186045d89866eafa9a9e1f8
4
+ data.tar.gz: aa3f269bc9ec2b4b8e87403466ccf528cc5f2cc5fc60155c2e772e5fa562231e
5
5
  SHA512:
6
- metadata.gz: 23e107bdbab77c58cd6d3244f04446efa54753c7a86b356b210b520fcceb79330c45fa2424cc0fd79ad167ff953e99f9b001b0be33fa3b89fe1fa38e1fd40e7b
7
- data.tar.gz: ac63d1313f2d5bad6ca3448e0b296947790355cc1f6c2a67d54eed3d19172195727a108ae90f91881b1377312fdc517229227173b4407d03b190ae350e13a0c1
6
+ metadata.gz: 790a0ee9aee36fa6b636e8bb9b252428b6d236ed6e45df3e3a3119de5cf25a40027fffe5e92f2968999311a9e14fafa35bc2e7c155df67faa54a334204af8a47
7
+ data.tar.gz: 6642ffd446bb0666af1cbb96730ac8b13c276d1d9f0bf9db35ca3f0f8f86f3df868ab05cc6aefbe754e18f4f6b909e44b0dfee4d77e994c0f29f2b7ee2d2d08a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- # Workhorse Change log
1
+ # Workhorse Changelog
2
+
3
+ ## 0.6.3 - 2019-09-02
4
+
5
+ * Fix examples in changelog, readme and generator for starting workers. Some of
6
+ the examples were non-functional after the changes introduced by 0.6.0.
2
7
 
3
8
  ## 0.6.2 - 2019-07-10
4
9
 
@@ -21,7 +26,7 @@
21
26
 
22
27
  ```ruby
23
28
  Workhorse::Daemon::ShellHandler.run count: 5 do
24
- # ... worker code
29
+ Workhorse::Worker.start_and_wait(pool_size: 1, logger: Rails.logger)
25
30
  end
26
31
  ```
27
32
 
@@ -31,7 +36,7 @@
31
36
  Workhorse::Daemon::ShellHandler.run do |daemon|
32
37
  5.times do
33
38
  daemon.worker do
34
- # ... worker code
39
+ Workhorse::Worker.start_and_wait(pool_size: 1, logger: Rails.logger)
35
40
  end
36
41
  end
37
42
  end
data/README.md CHANGED
@@ -95,7 +95,7 @@ Workhorse allows you to easily queue
95
95
  method `Workhorse.enqueue_op`:
96
96
 
97
97
  ```ruby
98
- Workhorse.enqueue_op Operations::Jobs::CleanUpDatabase, { quiet: true }, queue: :maintenance, priority: 2
98
+ Workhorse.enqueue_op Operations::Jobs::CleanUpDatabase, { queue: :maintenance, priority: 2 }, quiet: true
99
99
  ```
100
100
 
101
101
  Params passed using the second argument will be used for operation instantiation
@@ -172,7 +172,7 @@ achieving regular execution:
172
172
  # Start 5 worker processes with 3 threads each
173
173
  5.times do
174
174
  daemon.worker do
175
- Workhorse::Worker.new(pool_size: 3, polling_interval: 10, logger: Rails.logger)
175
+ Workhorse::Worker.start_and_wait(pool_size: 3, polling_interval: 10, logger: Rails.logger)
176
176
  end
177
177
  end
178
178
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -2,6 +2,10 @@
2
2
 
3
3
  require './config/environment'
4
4
 
5
- Workhorse::Daemon::ShellHandler.run do
6
- Workhorse::Worker.start_and_wait(pool_size: 5, logger: Rails.logger)
5
+ Workhorse::Daemon::ShellHandler.run do |daemon|
6
+ 5.times do
7
+ daemon.worker do
8
+ Workhorse::Worker.start_and_wait(pool_size: 1, logger: Rails.logger)
9
+ end
10
+ end
7
11
  end
@@ -8,8 +8,8 @@ Workhorse.setup do |config|
8
8
  # Enable and configure this to specify an alternative callback for handling
9
9
  # transactions.
10
10
  #
11
- # config.tx_callback = proc do |&block|
12
- # ActiveRecord::Base.transaction&(&block)
11
+ # self.tx_callback = proc do |*args, &block|
12
+ # ActiveRecord::Base.transaction(*args, &block)
13
13
  # end
14
14
 
15
15
  # Enable and configure this to specify a callback for handling worker
data/lib/workhorse.rb CHANGED
@@ -20,8 +20,8 @@ module Workhorse
20
20
  end
21
21
 
22
22
  mattr_accessor :tx_callback
23
- self.tx_callback = proc do |&block|
24
- ActiveRecord::Base.transaction(&block)
23
+ self.tx_callback = proc do |*args, &block|
24
+ ActiveRecord::Base.transaction(*args, &block)
25
25
  end
26
26
 
27
27
  mattr_accessor :on_exception
data/workhorse.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: workhorse 0.6.2 ruby lib
2
+ # stub: workhorse 0.6.3 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "workhorse".freeze
6
- s.version = "0.6.2"
6
+ s.version = "0.6.3"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Sitrox".freeze]
11
- s.date = "2019-07-10"
11
+ s.date = "2019-09-02"
12
12
  s.files = [".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, ".travis.yml".freeze, "CHANGELOG.md".freeze, "FAQ.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "RUBY_VERSION".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/rubocop".freeze, "lib/active_job/queue_adapters/workhorse_adapter.rb".freeze, "lib/generators/workhorse/install_generator.rb".freeze, "lib/generators/workhorse/templates/bin/workhorse.rb".freeze, "lib/generators/workhorse/templates/config/initializers/workhorse.rb".freeze, "lib/generators/workhorse/templates/create_table_jobs.rb".freeze, "lib/workhorse.rb".freeze, "lib/workhorse/daemon.rb".freeze, "lib/workhorse/daemon/shell_handler.rb".freeze, "lib/workhorse/db_job.rb".freeze, "lib/workhorse/enqueuer.rb".freeze, "lib/workhorse/jobs/cleanup_succeeded_jobs.rb".freeze, "lib/workhorse/jobs/run_active_job.rb".freeze, "lib/workhorse/jobs/run_rails_op.rb".freeze, "lib/workhorse/performer.rb".freeze, "lib/workhorse/poller.rb".freeze, "lib/workhorse/pool.rb".freeze, "lib/workhorse/scoped_env.rb".freeze, "lib/workhorse/worker.rb".freeze, "test/active_job/queue_adapters/workhorse_adapter_test.rb".freeze, "test/lib/db_schema.rb".freeze, "test/lib/jobs.rb".freeze, "test/lib/test_helper.rb".freeze, "test/workhorse/db_job_test.rb".freeze, "test/workhorse/enqueuer_test.rb".freeze, "test/workhorse/performer_test.rb".freeze, "test/workhorse/poller_test.rb".freeze, "test/workhorse/pool_test.rb".freeze, "test/workhorse/worker_test.rb".freeze, "workhorse.gemspec".freeze]
13
13
  s.rubygems_version = "3.0.3".freeze
14
14
  s.summary = "Multi-threaded job backend with database queuing for ruby.".freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workhorse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2019-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler