sidekiq-sequence 0.1.4 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.autotest +10 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +89 -0
- data/lib/sidekiq/sequence.rb +4 -2
- data/lib/sidekiq/sequence/base.rb +9 -13
- data/lib/sidekiq/sequence/version.rb +1 -1
- data/sidekiq-sequence.gemspec +3 -0
- metadata +37 -9
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9277190a95f032f08017866653a6bb073bde7a5546b1300707d0290d96a4b363
|
4
|
+
data.tar.gz: 23a86b0b37f95135ec439728bd286e04f836bcea638b7808b52ec214f8bfabfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6067738cadae32d9125cb295bc2c19d7e0f0d209294a3702794c1f4ea85b5f12bbd165402ee5f23f45b066e75ad557e2b1a4f4e56270d1bb1db707d3216e7b3d
|
7
|
+
data.tar.gz: 07eb2b647ed37fee81a845cc2c64c62e2c76ad252e44ebe4bf52a7bc532ca91dcd971b8f556fa66fd469f56cf38f4c5063c4538eafe315370710097b65cc6bec
|
data/.autotest
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq-sequence (0.1.8)
|
5
|
+
activerecord (>= 5)
|
6
|
+
railties (>= 5)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (6.1.3.1)
|
12
|
+
actionview (= 6.1.3.1)
|
13
|
+
activesupport (= 6.1.3.1)
|
14
|
+
rack (~> 2.0, >= 2.0.9)
|
15
|
+
rack-test (>= 0.6.3)
|
16
|
+
rails-dom-testing (~> 2.0)
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (6.1.3.1)
|
19
|
+
activesupport (= 6.1.3.1)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
activemodel (6.1.3.1)
|
25
|
+
activesupport (= 6.1.3.1)
|
26
|
+
activerecord (6.1.3.1)
|
27
|
+
activemodel (= 6.1.3.1)
|
28
|
+
activesupport (= 6.1.3.1)
|
29
|
+
activesupport (6.1.3.1)
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
|
+
i18n (>= 1.6, < 2)
|
32
|
+
minitest (>= 5.1)
|
33
|
+
tzinfo (~> 2.0)
|
34
|
+
zeitwerk (~> 2.3)
|
35
|
+
autotest-suffix (1.1.0)
|
36
|
+
builder (3.2.4)
|
37
|
+
concurrent-ruby (1.1.8)
|
38
|
+
crass (1.0.6)
|
39
|
+
erubi (1.10.0)
|
40
|
+
i18n (1.8.10)
|
41
|
+
concurrent-ruby (~> 1.0)
|
42
|
+
loofah (2.9.1)
|
43
|
+
crass (~> 1.0.2)
|
44
|
+
nokogiri (>= 1.5.9)
|
45
|
+
method_source (1.0.0)
|
46
|
+
mini_portile2 (2.5.0)
|
47
|
+
minitest (5.14.4)
|
48
|
+
minitest-autotest (1.1.1)
|
49
|
+
minitest-server (~> 1.0)
|
50
|
+
path_expander (~> 1.0)
|
51
|
+
minitest-server (1.0.6)
|
52
|
+
minitest (~> 5.0)
|
53
|
+
nokogiri (1.11.3)
|
54
|
+
mini_portile2 (~> 2.5.0)
|
55
|
+
racc (~> 1.4)
|
56
|
+
path_expander (1.1.0)
|
57
|
+
racc (1.5.2)
|
58
|
+
rack (2.2.3)
|
59
|
+
rack-test (1.1.0)
|
60
|
+
rack (>= 1.0, < 3)
|
61
|
+
rails-dom-testing (2.0.3)
|
62
|
+
activesupport (>= 4.2.0)
|
63
|
+
nokogiri (>= 1.6)
|
64
|
+
rails-html-sanitizer (1.3.0)
|
65
|
+
loofah (~> 2.3)
|
66
|
+
railties (6.1.3.1)
|
67
|
+
actionpack (= 6.1.3.1)
|
68
|
+
activesupport (= 6.1.3.1)
|
69
|
+
method_source
|
70
|
+
rake (>= 0.8.7)
|
71
|
+
thor (~> 1.0)
|
72
|
+
rake (13.0.3)
|
73
|
+
thor (1.1.0)
|
74
|
+
tzinfo (2.0.4)
|
75
|
+
concurrent-ruby (~> 1.0)
|
76
|
+
zeitwerk (2.4.2)
|
77
|
+
|
78
|
+
PLATFORMS
|
79
|
+
ruby
|
80
|
+
|
81
|
+
DEPENDENCIES
|
82
|
+
autotest-suffix
|
83
|
+
minitest
|
84
|
+
minitest-autotest
|
85
|
+
rake
|
86
|
+
sidekiq-sequence!
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
2.2.15
|
data/lib/sidekiq/sequence.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'rails'
|
4
|
+
require 'active_support/dependencies'
|
3
5
|
require 'sidekiq/sequence/version'
|
4
6
|
require 'sidekiq/sequence/engine'
|
5
|
-
require 'sidekiq/sequence/base'
|
6
|
-
require 'sidekiq/sequence/worker'
|
7
7
|
|
8
8
|
module Sidekiq
|
9
9
|
module Sequence
|
10
|
+
autoload :Base, 'sidekiq/sequence/base'
|
11
|
+
autoload :Worker, 'sidekiq/sequence/worker'
|
10
12
|
end
|
11
13
|
end
|
@@ -2,25 +2,22 @@
|
|
2
2
|
|
3
3
|
module Sidekiq
|
4
4
|
module Sequence
|
5
|
-
# rubocop:disable Style/ClassVars
|
6
5
|
class Base
|
7
|
-
|
6
|
+
class << self
|
7
|
+
attr_reader :steps
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def self.steps
|
15
|
-
@@steps
|
9
|
+
def step(worker_class)
|
10
|
+
@steps = [] if steps.nil?
|
11
|
+
@steps << worker_class.name
|
12
|
+
end
|
16
13
|
end
|
17
14
|
|
18
15
|
def self.perform_step(index, id)
|
19
|
-
if index >=
|
16
|
+
if index >= steps.size
|
20
17
|
# No more steps in the sequence, so delete the record.
|
21
18
|
Record.destroy id
|
22
19
|
else
|
23
|
-
|
20
|
+
steps[index].constantize.perform_async id
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
@@ -28,9 +25,8 @@ module Sidekiq
|
|
28
25
|
record = Record.create(data: data)
|
29
26
|
|
30
27
|
# Start first job in the sequence.
|
31
|
-
|
28
|
+
self.class.steps.first.constantize.perform_async record.id
|
32
29
|
end
|
33
30
|
end
|
34
|
-
# rubocop:enable Style/ClassVars
|
35
31
|
end
|
36
32
|
end
|
data/sidekiq-sequence.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-sequence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5'
|
13
41
|
description: Create and manage sequential jobs in Sidekiq
|
14
42
|
email:
|
15
43
|
- joel@developwithstyle.com
|
@@ -17,16 +45,16 @@ executables: []
|
|
17
45
|
extensions: []
|
18
46
|
extra_rdoc_files: []
|
19
47
|
files:
|
48
|
+
- ".autotest"
|
20
49
|
- ".gitignore"
|
21
50
|
- ".travis.yml"
|
22
51
|
- CODE_OF_CONDUCT.md
|
23
52
|
- Gemfile
|
53
|
+
- Gemfile.lock
|
24
54
|
- LICENSE.txt
|
25
55
|
- README.md
|
26
56
|
- Rakefile
|
27
57
|
- app/models/sidekiq/sequence/record.rb
|
28
|
-
- bin/console
|
29
|
-
- bin/setup
|
30
58
|
- lib/generators/sidekiq_sequence/install_generator.rb
|
31
59
|
- lib/generators/sidekiq_sequence/templates/migration.rb.tt
|
32
60
|
- lib/sidekiq/sequence.rb
|
@@ -43,7 +71,7 @@ metadata:
|
|
43
71
|
homepage_uri: https://github.com/joelmoss/sidekiq-sequence
|
44
72
|
source_code_uri: https://github.com/joelmoss/sidekiq-sequence
|
45
73
|
changelog_uri: https://github.com/joelmoss/sidekiq-sequence/releases
|
46
|
-
post_install_message:
|
74
|
+
post_install_message:
|
47
75
|
rdoc_options: []
|
48
76
|
require_paths:
|
49
77
|
- lib
|
@@ -58,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
86
|
- !ruby/object:Gem::Version
|
59
87
|
version: '0'
|
60
88
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
62
|
-
signing_key:
|
89
|
+
rubygems_version: 3.2.3
|
90
|
+
signing_key:
|
63
91
|
specification_version: 4
|
64
92
|
summary: Sequential Sidekiq jobs
|
65
93
|
test_files: []
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "sidekiq/sequence"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|