stalking 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,3 +8,5 @@ install:
8
8
  - "travis_retry bundle install"
9
9
 
10
10
  script: "bundle exec rake test"
11
+ sudo: false
12
+
data/README.md CHANGED
@@ -189,7 +189,7 @@ method and takes a string error message.
189
189
 
190
190
  # Graceful termination
191
191
 
192
- To stop a worker gracefully, send a QUIT signal to it. The worker will
192
+ To stop a worker gracefully, send a QUIT or USR2 signal to it. The worker will
193
193
  finish its current job and terminate afterwards.
194
194
 
195
195
  ## Contributing
@@ -82,6 +82,12 @@ module Stalking
82
82
  continue = false
83
83
  end
84
84
 
85
+ trap "USR2" do
86
+ exit unless @locked
87
+
88
+ continue = false
89
+ end
90
+
85
91
  while continue
86
92
  yield
87
93
  end
@@ -1,3 +1,3 @@
1
1
  module Stalking
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -206,7 +206,7 @@ class Stalking::ConsumerTest < Minitest::Test
206
206
 
207
207
  consumer.send :looping do
208
208
  consumer.send :lock do # Don't invoke exit
209
- Process.kill "QUIT", Process.pid
209
+ Process.kill "USR2", Process.pid
210
210
  end
211
211
  end
212
212
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stalking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-14 00:00:00.000000000 Z
12
+ date: 2015-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake