acidic_job 0.7.0 → 0.7.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: f6f61f9992e6528f4e7c1b6a5b774cd1fa1557b4f069fbd14b5e415298dbde15
4
- data.tar.gz: 46e279aca2bdc5e2379b496374334f0687dff92c845c2c4725d7e7fa7b96b571
3
+ metadata.gz: 970e9128c668bd3d5950a517eae9c215ee6c85d4d56a69fc8862afc622046df2
4
+ data.tar.gz: e04595bedefa12976e37661b34cb04544966af203c92df88a943e11667bab23f
5
5
  SHA512:
6
- metadata.gz: 8042feab92bccc37ad4006145c7c1c780da1eb94cf24f11dfc6808ce95edc18c986ca2424c4aa9c468444267da21ff103089ad0a7e9577a7e6f3e32d097daba7
7
- data.tar.gz: fc7ea7a48fc6560c3984538d9c8d2dd681492f22bd60bd4104d4db39a1bed53b950a386384f4db43caf22bc72ab0c3c9b39c7e36eb4232f646ee6e1ef7885430
6
+ metadata.gz: d95c1a6446e528300fb0d61ce45c897796ecca97af639a9f76a7375b39bd4332e7011d93663738a8eae08f93ae896b5663522ca372eddbf93d106eec79430db5
7
+ data.tar.gz: 550c9c53c6bde0b1b572ed3e0e98d470b78af0cdc0b1e2a50294ec7c3432421de64b01389df9c43f2e2fe24430d38de94c67d3be8f58660fc182130453ae73a5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acidic_job (0.7.0)
4
+ acidic_job (0.7.1)
5
5
  activerecord (>= 4.0.0)
6
6
  activesupport
7
7
 
@@ -144,4 +144,4 @@ DEPENDENCIES
144
144
  sqlite3
145
145
 
146
146
  BUNDLED WITH
147
- 2.2.5
147
+ 2.2.31
data/README.md CHANGED
@@ -157,6 +157,8 @@ This allows `acidic_job` to use an `after_perform` callback to delete the `Acidi
157
157
 
158
158
  One final feature for those of you using Sidekiq Pro: an integrated DSL for Sidekiq Batches. By simply adding the `awaits` option to your step declarations, you can attach any number of additional, asynchronous workers to your step. This is profoundly powerful, as it means that you can define a workflow where step 2 is started _if and only if_ step 1 succeeds, but step 1 can have 3 different workers enqueued on 3 different queues, each running in parallel. Once all 3 workers succeed, `acidic_job` will move on to step 2. That's right, by leveraging the power of Sidekiq Batches, you can have workers that are executed in parallel, on separate queues, and asynchronously, but are still blocking—as a group—the next step in your workflow! This unlocks incredible power and flexibility for defining and structuring complex workflows and operations, and in my mind is the number one selling point for Sidekiq Pro.
159
159
 
160
+ In my opinion, any commercial software using Sidekiq should get Sidekiq Pro; it is _absolutely_ worth the money. If, however, you are using `acidic_job` in a non-commercial application, you could use the open-source dropin replacement for this functionality: https://github.com/breamware/sidekiq-batch
161
+
160
162
  ## Development
161
163
 
162
164
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -16,4 +16,10 @@ module AcidicJob
16
16
  class UnknownJobAdapter < Error; end
17
17
 
18
18
  class NoDefinedSteps < Error; end
19
+
20
+ class SidekiqBatchRequired < Error; end
21
+
22
+ class TooManyParametersForStepMethod < Error; end
23
+
24
+ class TooManyParametersForParallelJob < Error; end
19
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AcidicJob
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
data/lib/acidic_job.rb CHANGED
@@ -9,6 +9,7 @@ require_relative "acidic_job/key"
9
9
  require_relative "acidic_job/staged"
10
10
  require_relative "acidic_job/perform_wrapper"
11
11
  require_relative "acidic_job/perform_transactionally_extension"
12
+ require_relative "acidic_job/deliver_transactionally_extension"
12
13
  require_relative "acidic_job/sidekiq_callbacks"
13
14
  require "active_support/concern"
14
15
 
@@ -277,8 +278,7 @@ module AcidicJob
277
278
  elsif callable.arity == 1
278
279
  callable.call(key)
279
280
  else
280
- # TODO
281
- raise
281
+ raise TooManyParametersForStepMethod
282
282
  end
283
283
 
284
284
  if result.is_a?(Response)
@@ -295,7 +295,7 @@ module AcidicJob
295
295
  def enqueue_step_parallel_jobs(jobs)
296
296
  # TODO: GIVE PROPER ERROR
297
297
  # `batch` is available from Sidekiq::Pro
298
- raise unless defined?(Sidekiq::Batch)
298
+ raise SidekiqBatchRequired unless defined?(Sidekiq::Batch)
299
299
 
300
300
  batch.jobs do
301
301
  step_batch = Sidekiq::Batch.new
@@ -317,7 +317,7 @@ module AcidicJob
317
317
  elsif worker.instance_method(:perform).arity == 1
318
318
  worker.perform_async(key.id)
319
319
  else
320
- raise
320
+ raise TooManyParametersForParallelJob
321
321
  end
322
322
  end
323
323
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acidic_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fractaledmind
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-29 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.1.2
112
+ rubygems_version: 3.2.22
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Idempotent operations for Rails apps, built on top of ActiveJob.