ruby_rabbitmq_janus 3.0.0.pre.358 → 3.0.0.pre.364
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrj/rabbit/listener/base.rb +17 -0
- data/lib/rrj/rabbit/listener/from.rb +2 -15
- data/lib/rrj/rabbit/listener/from_admin.rb +2 -15
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c74457de633e88b2adf434388d25891c36c054e1971ac3db811c2775aaf3eb6
|
4
|
+
data.tar.gz: fa3ac97940e279b12eb37709036ae458dc1bb2462b368f0101d9598d0619e99f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0636b53b95fe1368338e830a45cc160d8c0f4a2313326cce2db6caa1ce7cee1fa1159d0a6066783a48e16b650c756dcb1fe25ef0e3a4be3957e1bd9db1e9d802
|
7
|
+
data.tar.gz: 50ed1a722a64f7a7c8dbac60fd2440b335e25b34a6ffaf30a9f09ce5a62cf0305c9ab25fcd85007ab69e153067750953ae7e0699bc0dace10616cdbf2f094844
|
@@ -51,6 +51,23 @@ module RubyRabbitmqJanus
|
|
51
51
|
raise Errors::Rabbit::Listener::ResponseEmpty, response \
|
52
52
|
if response.to_hash.size.zero?
|
53
53
|
end
|
54
|
+
|
55
|
+
def subscribe_queue
|
56
|
+
rabbit.prefetch(1)
|
57
|
+
reply.bind(binding).subscribe(opts_subs) do |info, prop, payload|
|
58
|
+
info_subscribe(info, prop, payload)
|
59
|
+
synchronize_response(info, payload)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def synchronize_response(info, payload)
|
64
|
+
lock.synchronize do
|
65
|
+
response = response_class(payload)
|
66
|
+
rabbit.acknowledge(info.delivery_tag, false)
|
67
|
+
responses.push(response)
|
68
|
+
end
|
69
|
+
semaphore.signal
|
70
|
+
end
|
54
71
|
end
|
55
72
|
end
|
56
73
|
end
|
@@ -15,21 +15,8 @@ module RubyRabbitmqJanus
|
|
15
15
|
rabbit.queue(Tools::Config.instance.queue_from)
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
reply.bind(binding).subscribe(opts_subs) do |info, prop, payload|
|
21
|
-
info_subscribe(info, prop, payload)
|
22
|
-
synchronize_response(info, payload)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def synchronize_response(info, payload)
|
27
|
-
lock.synchronize do
|
28
|
-
response = Janus::Responses::Event.new(JSON.parse(payload))
|
29
|
-
responses.push(response)
|
30
|
-
end
|
31
|
-
rabbit.acknowledge(info.delivery_tag, false)
|
32
|
-
semaphore.signal
|
18
|
+
def response_class(payload)
|
19
|
+
Janus::Responses::Event.new(JSON.parse(payload))
|
33
20
|
end
|
34
21
|
end
|
35
22
|
end
|
@@ -15,21 +15,8 @@ module RubyRabbitmqJanus
|
|
15
15
|
rabbit.queue(Tools::Config.instance.queue_admin_from)
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
reply.bind(binding).subscribe(opts_subs) do |info, prop, payload|
|
21
|
-
info_subscribe(info, prop, payload)
|
22
|
-
synchronize_response(info, payload)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def synchronize_response(info, payload)
|
27
|
-
lock.synchronize do
|
28
|
-
response = Janus::Responses::Admin.new(JSON.parse(payload))
|
29
|
-
responses.push(response)
|
30
|
-
end
|
31
|
-
rabbit.acknowledge(info.delivery_tag, false)
|
32
|
-
semaphore.signal
|
18
|
+
def response_class(payload)
|
19
|
+
Janus::Responses::Admin.new(JSON.parse(payload))
|
33
20
|
end
|
34
21
|
end
|
35
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.pre.
|
4
|
+
version: 3.0.0.pre.364
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -52,6 +52,26 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bigdecimal
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.4'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.4.4
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.4'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.4.4
|
55
75
|
- !ruby/object:Gem::Dependency
|
56
76
|
name: database_cleaner
|
57
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -756,7 +776,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
756
776
|
- !ruby/object:Gem::Version
|
757
777
|
version: 1.3.1
|
758
778
|
requirements: []
|
759
|
-
rubygems_version: 3.
|
779
|
+
rubygems_version: 3.1.2
|
760
780
|
signing_key:
|
761
781
|
specification_version: 4
|
762
782
|
summary: Ruby RabbitMQ Janus
|