sidekiq-fast-enq 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +4 -15
- data/.travis.yml +28 -0
- data/Appraisals +9 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +54 -0
- data/HISTORY.md +11 -0
- data/README.md +3 -1
- data/Rakefile +19 -19
- data/VERSION +1 -1
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/sidekiq_3.gemfile +7 -0
- data/gemfiles/sidekiq_3.gemfile.lock +74 -0
- data/gemfiles/sidekiq_4.gemfile +7 -0
- data/gemfiles/sidekiq_4.gemfile.lock +56 -0
- data/gemfiles/sidekiq_5.gemfile +7 -0
- data/gemfiles/sidekiq_5.gemfile.lock +55 -0
- data/gemfiles/sidekiq_6.gemfile +7 -0
- data/gemfiles/sidekiq_6.gemfile.lock +55 -0
- data/lib/sidekiq-fast-enq.rb +8 -8
- data/sidekiq_fast_enq.gemspec +2 -1
- data/spec/spec_helper.rb +4 -6
- metadata +35 -9
- data/HISTORY.txt +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4da5e233e31395aeb7d4c2d648d32d98a22fd8d44a9d071ff1dfdac32044dd57
|
4
|
+
data.tar.gz: baa9d5acec682b20f5b5fa22471e53bf7e86d42fab0c1eae93394c35193b8351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 001ebe9e5b792d3f26ac4c92bc981692e89b006b098d069fe57acba025b1b500182c56684db8ab15190b621464cebe0fb7ef7912fb0c045f3a70d40176e5d0df
|
7
|
+
data.tar.gz: c8423d0302b4e8afb7077fcd665f6fb671b595222a4a0acf6ecd7426c47f5fafcbff917d80c19fe860669d2059362d768620e25d4c7b849d5dc345013d98f441
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- "2.6"
|
5
|
+
|
6
|
+
services:
|
7
|
+
- redis-server
|
8
|
+
|
9
|
+
gemfile:
|
10
|
+
- Gemfile
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
include:
|
14
|
+
- rvm: "2.6"
|
15
|
+
gemfile: gemfiles/sidekiq_6.gemfile
|
16
|
+
|
17
|
+
- rvm: "2.5"
|
18
|
+
gemfile: gemfiles/sidekiq_5.gemfile
|
19
|
+
|
20
|
+
- rvm: "2.5"
|
21
|
+
gemfile: gemfiles/sidekiq_4.gemfile
|
22
|
+
|
23
|
+
- rvm: "2.4"
|
24
|
+
gemfile: gemfiles/sidekiq_3.gemfile
|
25
|
+
|
26
|
+
script:
|
27
|
+
- gem list bundler
|
28
|
+
- bundle exec rake spec
|
data/Appraisals
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq-fast-enq (1.0.2)
|
5
|
+
sidekiq (>= 3.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
appraisal (2.2.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
thor (>= 0.14.0)
|
14
|
+
connection_pool (2.2.2)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
rack (2.1.1)
|
17
|
+
rack-protection (2.0.8.1)
|
18
|
+
rack
|
19
|
+
rake (13.0.1)
|
20
|
+
redis (4.1.3)
|
21
|
+
rspec (3.9.0)
|
22
|
+
rspec-core (~> 3.9.0)
|
23
|
+
rspec-expectations (~> 3.9.0)
|
24
|
+
rspec-mocks (~> 3.9.0)
|
25
|
+
rspec-core (3.9.1)
|
26
|
+
rspec-support (~> 3.9.1)
|
27
|
+
rspec-expectations (3.9.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.9.0)
|
30
|
+
rspec-mocks (3.9.1)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.9.0)
|
33
|
+
rspec-support (3.9.2)
|
34
|
+
sidekiq (6.0.4)
|
35
|
+
connection_pool (>= 2.2.2)
|
36
|
+
rack (>= 2.0.0)
|
37
|
+
rack-protection (>= 2.0.0)
|
38
|
+
redis (>= 4.1.0)
|
39
|
+
thor (1.0.1)
|
40
|
+
timecop (0.9.1)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
appraisal
|
47
|
+
bundler
|
48
|
+
rake
|
49
|
+
rspec
|
50
|
+
sidekiq-fast-enq!
|
51
|
+
timecop
|
52
|
+
|
53
|
+
BUNDLED WITH
|
54
|
+
2.1.4
|
data/HISTORY.md
ADDED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/weheartit/sidekiq-fast-enq.svg?branch=master)](https://travis-ci.org/weheartit/sidekiq-fast-enq)
|
2
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/cafd3e45419babe96ac4/maintainability)](https://codeclimate.com/github/weheartit/sidekiq-fast-enq/maintainability)
|
3
|
+
|
1
4
|
This gem provides a much more efficien implementation for checking the Sidekiq scheduled and retry queues. This can provide a significant performance boost for large sidekiq implementations that utilize many processes. It can also reduce load on the redis server.
|
2
5
|
|
3
6
|
### TL;DR
|
@@ -19,5 +22,4 @@ Sidekiq.options[:scheduled_enq] = SidekiqFastEnq
|
|
19
22
|
Sidekiq.options[:poll_interval_average] = 30
|
20
23
|
```
|
21
24
|
|
22
|
-
Since this gem eliminates the race condition of having too many processes processing th
|
23
25
|
Note: this gem utilizes server side Lua scripting so you must be using Redis Server 2.6.0 or later.
|
data/Rakefile
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
2
3
|
|
3
|
-
|
4
|
-
task :default => :test
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
5
|
|
6
|
-
|
7
|
-
task :tests => :test
|
6
|
+
task :default => :appraisals
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
desc "run the specs using appraisal"
|
9
|
+
task :appraisals do
|
10
|
+
exec "bundle exec appraisal rake spec"
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace :appraisals do
|
14
|
+
desc "install all the appraisal gemspecs"
|
15
|
+
task :install do
|
16
|
+
exec "bundle exec appraisal install"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -22,36 +22,36 @@ task :load_test, [:jobs_size, :workers, :fast] do |t, args|
|
|
22
22
|
require File.expand_path('../lib/sidekiq-fast-enq', __FILE__)
|
23
23
|
require 'sidekiq/scheduled'
|
24
24
|
require 'sidekiq/api'
|
25
|
-
|
25
|
+
|
26
26
|
class FastEnqLoadTestWorker
|
27
27
|
include Sidekiq::Worker
|
28
28
|
def perform()
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
jobs_size = args[:jobs_size].to_i
|
33
33
|
workers_size = args[:workers].to_i
|
34
34
|
klass = (args[:fast] == 'fast' ? SidekiqFastEnq : Sidekiq::Scheduled::Enq)
|
35
|
-
|
35
|
+
|
36
36
|
Sidekiq.configure_server do |config|
|
37
37
|
config.redis = {:namespace => "sidekiq_fast_enq_load_test"}
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
Sidekiq::ScheduledSet.new.clear
|
41
41
|
jobs_size.times do
|
42
42
|
FastEnqLoadTestWorker.perform_in(rand)
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
t = Time.now
|
46
46
|
workers_size.times do
|
47
47
|
fork do
|
48
48
|
klass.new.enqueue_jobs
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
workers_size.times do
|
53
53
|
Process.wait
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
puts "Enqueued #{jobs_size} jobs in #{Time.now - t} seconds"
|
57
57
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -0,0 +1,74 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
sidekiq-fast-enq (1.0.2)
|
5
|
+
sidekiq (>= 3.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
appraisal (2.2.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
thor (>= 0.14.0)
|
14
|
+
celluloid (0.17.4)
|
15
|
+
celluloid-essentials
|
16
|
+
celluloid-extras
|
17
|
+
celluloid-fsm
|
18
|
+
celluloid-pool
|
19
|
+
celluloid-supervision
|
20
|
+
timers (>= 4.1.1)
|
21
|
+
celluloid-essentials (0.20.5)
|
22
|
+
timers (>= 4.1.1)
|
23
|
+
celluloid-extras (0.20.5)
|
24
|
+
timers (>= 4.1.1)
|
25
|
+
celluloid-fsm (0.20.5)
|
26
|
+
timers (>= 4.1.1)
|
27
|
+
celluloid-pool (0.20.5)
|
28
|
+
timers (>= 4.1.1)
|
29
|
+
celluloid-supervision (0.20.6)
|
30
|
+
timers (>= 4.1.1)
|
31
|
+
connection_pool (2.2.2)
|
32
|
+
diff-lcs (1.3)
|
33
|
+
json (1.8.6)
|
34
|
+
rake (13.0.1)
|
35
|
+
redis (3.3.5)
|
36
|
+
redis-namespace (1.7.0)
|
37
|
+
redis (>= 3.0.4)
|
38
|
+
rspec (3.9.0)
|
39
|
+
rspec-core (~> 3.9.0)
|
40
|
+
rspec-expectations (~> 3.9.0)
|
41
|
+
rspec-mocks (~> 3.9.0)
|
42
|
+
rspec-core (3.9.1)
|
43
|
+
rspec-support (~> 3.9.1)
|
44
|
+
rspec-expectations (3.9.0)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.9.0)
|
47
|
+
rspec-mocks (3.9.1)
|
48
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
+
rspec-support (~> 3.9.0)
|
50
|
+
rspec-support (3.9.2)
|
51
|
+
sidekiq (3.5.4)
|
52
|
+
celluloid (~> 0.17.2)
|
53
|
+
connection_pool (~> 2.2, >= 2.2.0)
|
54
|
+
json (~> 1.0)
|
55
|
+
redis (~> 3.2, >= 3.2.1)
|
56
|
+
redis-namespace (~> 1.5, >= 1.5.2)
|
57
|
+
thor (1.0.1)
|
58
|
+
timecop (0.9.1)
|
59
|
+
timers (4.3.0)
|
60
|
+
|
61
|
+
PLATFORMS
|
62
|
+
ruby
|
63
|
+
|
64
|
+
DEPENDENCIES
|
65
|
+
appraisal
|
66
|
+
bundler
|
67
|
+
rake
|
68
|
+
rspec
|
69
|
+
sidekiq (~> 3.0)
|
70
|
+
sidekiq-fast-enq!
|
71
|
+
timecop
|
72
|
+
|
73
|
+
BUNDLED WITH
|
74
|
+
2.1.4
|
@@ -0,0 +1,56 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
sidekiq-fast-enq (1.0.2)
|
5
|
+
sidekiq (>= 3.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
appraisal (2.2.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
thor (>= 0.14.0)
|
14
|
+
concurrent-ruby (1.1.5)
|
15
|
+
connection_pool (2.2.2)
|
16
|
+
diff-lcs (1.3)
|
17
|
+
rack (2.1.1)
|
18
|
+
rack-protection (2.0.8.1)
|
19
|
+
rack
|
20
|
+
rake (13.0.1)
|
21
|
+
redis (3.3.5)
|
22
|
+
rspec (3.9.0)
|
23
|
+
rspec-core (~> 3.9.0)
|
24
|
+
rspec-expectations (~> 3.9.0)
|
25
|
+
rspec-mocks (~> 3.9.0)
|
26
|
+
rspec-core (3.9.1)
|
27
|
+
rspec-support (~> 3.9.1)
|
28
|
+
rspec-expectations (3.9.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.9.0)
|
31
|
+
rspec-mocks (3.9.1)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.9.0)
|
34
|
+
rspec-support (3.9.2)
|
35
|
+
sidekiq (4.2.10)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
connection_pool (~> 2.2, >= 2.2.0)
|
38
|
+
rack-protection (>= 1.5.0)
|
39
|
+
redis (~> 3.2, >= 3.2.1)
|
40
|
+
thor (1.0.1)
|
41
|
+
timecop (0.9.1)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
appraisal
|
48
|
+
bundler
|
49
|
+
rake
|
50
|
+
rspec
|
51
|
+
sidekiq (~> 4.0)
|
52
|
+
sidekiq-fast-enq!
|
53
|
+
timecop
|
54
|
+
|
55
|
+
BUNDLED WITH
|
56
|
+
2.1.4
|
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
sidekiq-fast-enq (1.0.2)
|
5
|
+
sidekiq (>= 3.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
appraisal (2.2.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
thor (>= 0.14.0)
|
14
|
+
connection_pool (2.2.2)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
rack (2.1.1)
|
17
|
+
rack-protection (2.0.8.1)
|
18
|
+
rack
|
19
|
+
rake (13.0.1)
|
20
|
+
redis (4.1.3)
|
21
|
+
rspec (3.9.0)
|
22
|
+
rspec-core (~> 3.9.0)
|
23
|
+
rspec-expectations (~> 3.9.0)
|
24
|
+
rspec-mocks (~> 3.9.0)
|
25
|
+
rspec-core (3.9.1)
|
26
|
+
rspec-support (~> 3.9.1)
|
27
|
+
rspec-expectations (3.9.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.9.0)
|
30
|
+
rspec-mocks (3.9.1)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.9.0)
|
33
|
+
rspec-support (3.9.2)
|
34
|
+
sidekiq (5.2.7)
|
35
|
+
connection_pool (~> 2.2, >= 2.2.2)
|
36
|
+
rack (>= 1.5.0)
|
37
|
+
rack-protection (>= 1.5.0)
|
38
|
+
redis (>= 3.3.5, < 5)
|
39
|
+
thor (1.0.1)
|
40
|
+
timecop (0.9.1)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
appraisal
|
47
|
+
bundler
|
48
|
+
rake
|
49
|
+
rspec
|
50
|
+
sidekiq (~> 5.0)
|
51
|
+
sidekiq-fast-enq!
|
52
|
+
timecop
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
2.1.4
|
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
sidekiq-fast-enq (1.0.2)
|
5
|
+
sidekiq (>= 3.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
appraisal (2.2.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
thor (>= 0.14.0)
|
14
|
+
connection_pool (2.2.2)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
rack (2.1.1)
|
17
|
+
rack-protection (2.0.8.1)
|
18
|
+
rack
|
19
|
+
rake (13.0.1)
|
20
|
+
redis (4.1.3)
|
21
|
+
rspec (3.9.0)
|
22
|
+
rspec-core (~> 3.9.0)
|
23
|
+
rspec-expectations (~> 3.9.0)
|
24
|
+
rspec-mocks (~> 3.9.0)
|
25
|
+
rspec-core (3.9.1)
|
26
|
+
rspec-support (~> 3.9.1)
|
27
|
+
rspec-expectations (3.9.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.9.0)
|
30
|
+
rspec-mocks (3.9.1)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.9.0)
|
33
|
+
rspec-support (3.9.2)
|
34
|
+
sidekiq (6.0.4)
|
35
|
+
connection_pool (>= 2.2.2)
|
36
|
+
rack (>= 2.0.0)
|
37
|
+
rack-protection (>= 2.0.0)
|
38
|
+
redis (>= 4.1.0)
|
39
|
+
thor (1.0.1)
|
40
|
+
timecop (0.9.1)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
appraisal
|
47
|
+
bundler
|
48
|
+
rake
|
49
|
+
rspec
|
50
|
+
sidekiq (~> 6.0)
|
51
|
+
sidekiq-fast-enq!
|
52
|
+
timecop
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
2.1.4
|
data/lib/sidekiq-fast-enq.rb
CHANGED
@@ -6,7 +6,7 @@ require 'sidekiq'
|
|
6
6
|
# race conditions checking the scheduled queues.
|
7
7
|
class SidekiqFastEnq
|
8
8
|
DEFAULT_BATCH_SIZE = 1000
|
9
|
-
|
9
|
+
|
10
10
|
def initialize(batch_size = nil)
|
11
11
|
batch_size ||= (Sidekiq.options[:fast_enq_batch_size] || DEFAULT_BATCH_SIZE)
|
12
12
|
@script = lua_script(batch_size)
|
@@ -14,11 +14,11 @@ class SidekiqFastEnq
|
|
14
14
|
@script_sha_1 = conn.script(:load, @script)
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def enqueue_jobs(now = Time.now.to_f.to_s, sorted_sets = nil)
|
19
19
|
sorted_sets ||= Sidekiq::Scheduled::SETS
|
20
|
-
logger = Sidekiq
|
21
|
-
|
20
|
+
logger = Sidekiq.logger
|
21
|
+
|
22
22
|
# A job's "score" in Redis is the time at which it should be processed.
|
23
23
|
# Just check Redis for the set of jobs with a timestamp before now.
|
24
24
|
Sidekiq.redis do |conn|
|
@@ -29,7 +29,7 @@ class SidekiqFastEnq
|
|
29
29
|
start_time = Time.now
|
30
30
|
pop_time = 0.0
|
31
31
|
enqueue_time = 0.0
|
32
|
-
|
32
|
+
|
33
33
|
# Get the next item in the queue if it's score (time to execute) is <= now.
|
34
34
|
# We need to go through the list one at a time to reduce the risk of something
|
35
35
|
# going wrong between the time jobs are popped from the scheduled queue and when
|
@@ -45,7 +45,7 @@ class SidekiqFastEnq
|
|
45
45
|
jobs_count += 1
|
46
46
|
logger.debug("enqueued #{sorted_set}: #{job}") if logger && logger.debug?
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
if jobs_count > 0 && logger && logger.info?
|
50
50
|
loop_time = Time.now - start_time
|
51
51
|
logger.info("SidekiqFastEnq enqueued #{jobs_count} from #{sorted_set} in #{loop_time.round(3)}s (pop: #{pop_time.round(3)}s; enqueue: #{enqueue_time.round(3)}s)")
|
@@ -61,7 +61,7 @@ class SidekiqFastEnq
|
|
61
61
|
def pop_job(conn, sorted_set, now)
|
62
62
|
eval_script(conn, @script, @script_sha_1, [sorted_set, now])
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
# Evaluate and execute a Lua script on the redis server.
|
66
66
|
def eval_script(conn, script, sha1, argv=[])
|
67
67
|
begin
|
@@ -87,7 +87,7 @@ class SidekiqFastEnq
|
|
87
87
|
local sorted_set = ARGV[1]
|
88
88
|
local now = tonumber(ARGV[2])
|
89
89
|
local ready_cache = sorted_set .. '.cache'
|
90
|
-
|
90
|
+
|
91
91
|
while true do
|
92
92
|
-- Check a cached list of jobs that are ready to execute
|
93
93
|
local job = redis.call('lpop', ready_cache)
|
data/sidekiq_fast_enq.gemspec
CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_dependency('sidekiq', '>=3.4')
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency "rspec"
|
25
25
|
spec.add_development_dependency "timecop"
|
26
|
+
spec.add_development_dependency "appraisal"
|
26
27
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# Breaks if not required. Sidekiq doesn't directly require in
|
2
2
|
# the load process.
|
3
3
|
|
4
|
-
|
5
|
-
gem 'sidekiq', *sidekiq_version
|
4
|
+
require_relative '../lib/sidekiq-fast-enq'
|
6
5
|
|
7
|
-
require File.expand_path('../../lib/sidekiq-fast-enq', __FILE__)
|
8
6
|
require 'timecop'
|
9
7
|
require 'sidekiq/version'
|
10
8
|
require 'celluloid' if Sidekiq::VERSION.to_i < 4
|
@@ -20,17 +18,17 @@ RSpec.configure do |config|
|
|
20
18
|
# the seed, which is printed after each run.
|
21
19
|
# --seed 1234
|
22
20
|
config.order = 'random'
|
23
|
-
|
21
|
+
|
24
22
|
Sidekiq.configure_server do |config|
|
25
23
|
config.redis = {:namespace => "sidekiq_fast_enq_test"}
|
26
24
|
end
|
27
25
|
Sidekiq.options[:scheduled_enq] = SidekiqFastEnq
|
28
|
-
Sidekiq
|
26
|
+
Sidekiq.logger.level = Logger::FATAL
|
29
27
|
end
|
30
28
|
|
31
29
|
class FastEnqTestWorker
|
32
30
|
include Sidekiq::Worker
|
33
|
-
|
31
|
+
|
34
32
|
def perform(arg)
|
35
33
|
end
|
36
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-fast-enq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- We Heart It
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -29,16 +29,16 @@ dependencies:
|
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: appraisal
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
84
98
|
description: More efficient scheduled job queue implementation for sidekiq to increase
|
85
99
|
throughput in large installations.
|
86
100
|
email:
|
@@ -91,11 +105,24 @@ extensions: []
|
|
91
105
|
extra_rdoc_files: []
|
92
106
|
files:
|
93
107
|
- ".gitignore"
|
94
|
-
-
|
108
|
+
- ".travis.yml"
|
109
|
+
- Appraisals
|
110
|
+
- Gemfile
|
111
|
+
- Gemfile.lock
|
112
|
+
- HISTORY.md
|
95
113
|
- MIT_LICENSE.txt
|
96
114
|
- README.md
|
97
115
|
- Rakefile
|
98
116
|
- VERSION
|
117
|
+
- gemfiles/.bundle/config
|
118
|
+
- gemfiles/sidekiq_3.gemfile
|
119
|
+
- gemfiles/sidekiq_3.gemfile.lock
|
120
|
+
- gemfiles/sidekiq_4.gemfile
|
121
|
+
- gemfiles/sidekiq_4.gemfile.lock
|
122
|
+
- gemfiles/sidekiq_5.gemfile
|
123
|
+
- gemfiles/sidekiq_5.gemfile.lock
|
124
|
+
- gemfiles/sidekiq_6.gemfile
|
125
|
+
- gemfiles/sidekiq_6.gemfile.lock
|
99
126
|
- lib/sidekiq-fast-enq.rb
|
100
127
|
- sidekiq_fast_enq.gemspec
|
101
128
|
- spec/sidekiq-fast-enq_spec.rb
|
@@ -119,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
146
|
- !ruby/object:Gem::Version
|
120
147
|
version: '0'
|
121
148
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.4.5
|
149
|
+
rubygems_version: 3.0.3
|
124
150
|
signing_key:
|
125
151
|
specification_version: 4
|
126
152
|
summary: More efficient scheduled job queue implementation for sidekiq
|