resque-fifo-queue 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: b962de3ad6dec018f3c39ae6dd0a1bce29552c6a
4
- data.tar.gz: 7bb016d06b063bd45459668ede1de61df13b0d6d
3
+ metadata.gz: a25c70e4b591afb416801f0dec6c0476416a4339
4
+ data.tar.gz: 69e80b0d5a41cbdf9872c323f29942d2ecb2c36f
5
5
  SHA512:
6
- metadata.gz: 3026f465971b56dd870ca6f177d0783ec0070d9231b0e4b17657664cadfe6bf22d753bbeeb7b64392472fddfa75cd8d828ed5b9bf675bfe8f0a1637f708ea764
7
- data.tar.gz: c584f50175d9ae9e9ef934427e0b10688f40867ab40a913f0616ec909974e21baf2275e9fe956fff3ce951d893636ae5cbc17641056350b0b265416e9bf8f221
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. The
86
- fifo shard table is updated everytime a worker is started or stopped properly (using kill -S QUITE).
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.
@@ -3,7 +3,6 @@ require 'resque/fifo/constants'
3
3
  require "redis"
4
4
  require "redlock"
5
5
  require 'xxhash'
6
- require 'resque_solo'
7
6
  require "resque/plugins/fifo/queue/version"
8
7
  require "resque/plugins/fifo/server"
9
8
  require "resque/plugins/fifo/extensions"
@@ -1,6 +1,7 @@
1
- require 'resque/fifo/queue'
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" => :environment do
12
+ task "resque:fifo-workers" do
12
13
  threads = []
13
14
 
14
15
  if ENV['COUNT'].to_i < 1
@@ -3,8 +3,6 @@ module Resque
3
3
  module Fifo
4
4
  module Queue
5
5
  class DrainWorker
6
- include Resque::Plugins::UniqueJob
7
-
8
6
  def self.perform
9
7
  Resque::Plugins::Fifo::Queue::Manager.new.update_workers
10
8
  end
@@ -2,7 +2,7 @@ module Resque
2
2
  module Plugins
3
3
  module Fifo
4
4
  module Queue
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
8
8
  end
@@ -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.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: 2017-11-27 00:00:00.000000000 Z
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