lapine 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lapine/consumer/runner.rb +12 -1
- data/lib/lapine/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00c5975716fde4c26b9c4f07e975ceafb7c5fc52
|
4
|
+
data.tar.gz: 4eea9f3c8a607fa6b40d7461b266a2abd354012b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db1368b8ae7112b58968ad0992e64242f20288cd4a9140fd531921cff03d13537625aeaf87a54d83b4fc20b10dd7ea3a17f1270a5005e36e94676318cac0bb86
|
7
|
+
data.tar.gz: f20f048d5e86cea988b11ae1d2f080d2da529266d50a55b95831118ee69818da26bb0806958d2915d9791284e58b341e8f37e9ab18efc191a59efeda0d0da7d1
|
@@ -38,6 +38,8 @@ module Lapine
|
|
38
38
|
@running_message_count += 1
|
39
39
|
end
|
40
40
|
metadata.ack
|
41
|
+
|
42
|
+
EventMachine.stop_event_loop if should_exit?
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
@@ -47,6 +49,10 @@ module Lapine
|
|
47
49
|
@message_count = 0
|
48
50
|
end
|
49
51
|
end
|
52
|
+
|
53
|
+
EventMachine.add_periodic_timer(5) do
|
54
|
+
EventMachine.stop_event_loop if should_exit?
|
55
|
+
end
|
50
56
|
end
|
51
57
|
|
52
58
|
logger.warn 'exiting Lapine::Consumer'
|
@@ -70,9 +76,14 @@ module Lapine
|
|
70
76
|
end
|
71
77
|
end
|
72
78
|
|
79
|
+
def should_exit?
|
80
|
+
$STOP_LAPINE_CONSUMER
|
81
|
+
end
|
82
|
+
|
73
83
|
def handle_signals!
|
84
|
+
$STOP_LAPINE_CONSUMER = false
|
74
85
|
Signal.trap('INT') { EventMachine.stop }
|
75
|
-
Signal.trap('TERM') {
|
86
|
+
Signal.trap('TERM') { $STOP_LAPINE_CONSUMER = true }
|
76
87
|
end
|
77
88
|
end
|
78
89
|
end
|
data/lib/lapine/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lapine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Saxby
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amqp
|
@@ -233,4 +233,3 @@ test_files:
|
|
233
233
|
- spec/lib/lapine_spec.rb
|
234
234
|
- spec/spec_helper.rb
|
235
235
|
- spec/support/rspec_test_helper.rb
|
236
|
-
has_rdoc:
|