resque-fifo-queue 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -10
- data/lib/resque/fifo/queue.rb +0 -1
- data/lib/resque/fifo/tasks.rb +4 -3
- data/lib/resque/plugins/fifo/queue/drain_worker.rb +0 -2
- data/lib/resque/plugins/fifo/queue/version.rb +1 -1
- data/resque-fifo-queue.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a25c70e4b591afb416801f0dec6c0476416a4339
|
4
|
+
data.tar.gz: 69e80b0d5a41cbdf9872c323f29942d2ecb2c36f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d8753985baedc02f5ee413fa4466706ceae626af39830103630d015b1e20fea9a0ab33bf27eaa1e9fd8a09e7f9d9c063e176e836a51240c947932d0914af199
|
7
|
+
data.tar.gz: 7cc503d852863dda10ffb313a0c437b62188d22972f9200db4a8cab5e44e33ecabba2d4ff5acb3620bc908ea2149476370ad824444cacce04c725f5f3fa636aa
|
data/README.md
CHANGED
@@ -74,18 +74,11 @@ workers and queues used. This can be accessed via:
|
|
74
74
|
|
75
75
|
http://localhost:3000/resque/fifo_queue
|
76
76
|
|
77
|
-
## Development
|
78
|
-
|
79
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
80
|
-
|
81
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
82
|
-
|
83
77
|
## Ensuring workers are updated
|
84
78
|
|
85
|
-
Since only one worker is assigned to a particular shard, it is important to make sure a worker is running
|
86
|
-
|
87
|
-
|
88
|
-
Though for some cases a scheduled task is necessary to make sure the worker list is constantly updated:
|
79
|
+
Since only one worker is assigned to a particular shard, it is important to make sure a worker is running otherwise jobs will
|
80
|
+
pile up for that shard. The shard table is updated everytime a worker is started or stopped properly (using kill -S QUITE). However
|
81
|
+
in exceptional cases (workers are forced killed for example), a shard may be left without a worker. In cases like this a scheduled task is necessary to make sure the worker list is constantly updated:
|
89
82
|
|
90
83
|
```yaml
|
91
84
|
# resque_schedule.yml
|
@@ -96,6 +89,21 @@ auto_refresh_fifo_queues:
|
|
96
89
|
description: 'Check if fifo workers are still valid and update worker table'
|
97
90
|
```
|
98
91
|
|
92
|
+
Do make sure to add the resque-scheduler as well https://github.com/resque/resque-scheduler
|
93
|
+
|
94
|
+
## Related Projects
|
95
|
+
|
96
|
+
If you need something more performant and robust, Apache Kafka is still the way to go. Though you need a couple more libraries
|
97
|
+
to set it up with rails.
|
98
|
+
|
99
|
+
https://github.com/karafka/karafka
|
100
|
+
|
101
|
+
## Development
|
102
|
+
|
103
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
104
|
+
|
105
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
106
|
+
|
99
107
|
## Contributing
|
100
108
|
|
101
109
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/resque-fifo-queue. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/resque/fifo/queue.rb
CHANGED
data/lib/resque/fifo/tasks.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+
task "resque:fifo-worker" => [ "resque:preload", "resque:setup" ] do
|
2
|
+
require 'resque'
|
3
|
+
require 'resque/fifo/queue'
|
2
4
|
|
3
|
-
task "resque:fifo-worker" => :environment do
|
4
5
|
prefix = ENV['PREFIX'] || 'fifo'
|
5
6
|
worker = Resque::Plugins::Fifo::Worker.new
|
6
7
|
worker.prepare
|
@@ -8,7 +9,7 @@ task "resque:fifo-worker" => :environment do
|
|
8
9
|
worker.work(ENV['INTERVAL'] || 5) # interval, will block
|
9
10
|
end
|
10
11
|
|
11
|
-
task "resque:fifo-workers"
|
12
|
+
task "resque:fifo-workers" do
|
12
13
|
threads = []
|
13
14
|
|
14
15
|
if ENV['COUNT'].to_i < 1
|
data/resque-fifo-queue.gemspec
CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "resque", "~> 1.27"
|
40
40
|
spec.add_dependency "resque-scheduler"
|
41
41
|
spec.add_dependency "resque-pause"
|
42
|
-
spec.add_dependency "resque_solo"
|
43
42
|
spec.add_dependency "xxhash"
|
44
43
|
spec.add_dependency "redlock"
|
45
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-fifo-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Emmanuel Dayo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: resque_solo
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :runtime
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: xxhash
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|