mimi-messaging 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mimi/messaging/request_processor.rb +17 -9
- data/lib/mimi/messaging/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59db6d2cf3e038d1cacc7ef50576e82d8372d042
|
4
|
+
data.tar.gz: b7f802bf48fb24f18e65bcd4c6fcfc17ed6bc0bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc08d35ccde1feb2bddd3a7920eab1384f111996d3a0137cf18a83e90bcfb669e20d57ac111e2dfbacb2fd4ece1f06044649dc35cfbaeff06e6955ebd3eb7735
|
7
|
+
data.tar.gz: 66432175a64cdb90f020c9b5a82aa51d8c58ebfeb01c581ea567e189c600f329e73b63944c35b024e3a42b1fb1b9890f17281d7c152ee210f156104f7c90bc85
|
@@ -46,22 +46,30 @@ module Mimi
|
|
46
46
|
raise "#{name} already started" if started?
|
47
47
|
logger.debug "#{self} starting to serve '#{resource_name}' (#{exposed_methods})"
|
48
48
|
@queue = construct_queue
|
49
|
-
@
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
@consumer_mutex = Mutex.new
|
50
|
+
@consumer_mutex.synchronize do
|
51
|
+
@consumer = @queue.subscribe(manual_ack: true) do |d, m, p|
|
52
|
+
begin
|
53
|
+
new(d, m, p)
|
54
|
+
rescue StandardError => e
|
55
|
+
logger.error e.to_s
|
56
|
+
logger.debug e.backtrace.join("\n")
|
57
|
+
ensure
|
58
|
+
@consumer_mutex.synchronize do
|
59
|
+
@consumer.channel.ack(d.delivery_tag) if @consumer.channel && @consumer.channel.active
|
60
|
+
end
|
61
|
+
end
|
57
62
|
end
|
58
63
|
end
|
64
|
+
# consumer created, mutex released
|
59
65
|
end
|
60
66
|
|
61
67
|
def self.stop
|
62
68
|
return if abstract?
|
63
69
|
raise "#{name} already stopped" unless started?
|
64
|
-
@
|
70
|
+
@consumer_mutex.synchronize do
|
71
|
+
@consumer.cancel if @consumer
|
72
|
+
end
|
65
73
|
@consumer = nil
|
66
74
|
@queue = nil
|
67
75
|
@channel = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimi-messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kukushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mimi-core
|