ruby_rabbitmq_janus 2.7.2.pre.319 → 2.7.2.pre.320
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rrj/process/event.rb +1 -1
- data/lib/rrj/process/event_admin.rb +34 -5
- data/lib/rrj/rabbit/listener/from.rb +4 -4
- data/lib/rrj/rabbit/listener/from_admin.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc50ee1b1b5ce39634a85050510221684d78a68cfb08947ae5e51ba60a492e3e
|
4
|
+
data.tar.gz: 3e95da4477afa9df8370611da6f25bae324770924d5a843727f0ad1b2af42e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec90884318b4edc421e7dd6bdf7de960001024f5f3179e09ac16787bb5ff6255165a644de050fd6ca90debf65cbea8c5295fa104a4a926084aa2b9db55915e6
|
7
|
+
data.tar.gz: 7af37d040a30723f419c992252d554f39ce85f19cfda389a1f652156422af9751706df12f9f92b49d8e5120a70c5b5fb5a31834731c5bc81be025c7e79cf806b
|
data/lib/rrj/process/event.rb
CHANGED
@@ -1,17 +1,46 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# :reek:InstanceVariableAssumption
|
4
|
-
|
5
3
|
module RubyRabbitmqJanus
|
6
4
|
module Process
|
7
5
|
module Concurrencies
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
6
|
+
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
7
|
+
#
|
8
|
+
# # Listen admin queue to all Janus instance
|
9
|
+
#
|
10
|
+
# Listen admin queue and sending a block code to thread listen.
|
11
|
+
# The default queue is configured in config file.
|
12
|
+
#
|
13
|
+
# @see file:/config/default.md For more information to config file used.
|
14
|
+
class EventAdmin < Concurrency
|
11
15
|
include Singleton
|
12
16
|
|
13
17
|
NAME_VAR = :publish_adm
|
14
18
|
|
19
|
+
def initialize
|
20
|
+
super
|
21
|
+
@thread = Thread.new { initialize_thread }
|
22
|
+
rescue
|
23
|
+
raise Errors::Process::Event::Initializer
|
24
|
+
end
|
25
|
+
|
26
|
+
# Create a thread for execute a block code in a thread
|
27
|
+
#
|
28
|
+
# @param [Proc] block Block code for execute action when queue
|
29
|
+
# standard 'from-janus' receive a message.This block is sending to
|
30
|
+
# publisher created for this thread.
|
31
|
+
#
|
32
|
+
# @return [Thread] It's a thread who listen queue and execute action
|
33
|
+
def run(&block)
|
34
|
+
@thread.join
|
35
|
+
Thread.new do
|
36
|
+
loop do
|
37
|
+
@thread.thread_variable_get(NAME_VAR).listen_events(&block)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
rescue
|
41
|
+
raise Errors::Process::Event::Run
|
42
|
+
end
|
43
|
+
|
15
44
|
private
|
16
45
|
|
17
46
|
def transaction_running
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# :reek:TooManyStatements
|
4
|
-
# :reek:InstanceVariableAssumption
|
5
|
-
|
6
3
|
module RubyRabbitmqJanus
|
7
4
|
module Rabbit
|
8
5
|
module Listener
|
@@ -14,8 +11,11 @@ module RubyRabbitmqJanus
|
|
14
11
|
class From < Base
|
15
12
|
private
|
16
13
|
|
14
|
+
def reply
|
15
|
+
rabbit.queue(Tools::Config.instance.queue_from)
|
16
|
+
end
|
17
|
+
|
17
18
|
def subscribe_queue
|
18
|
-
reply = rabbit.queue(Tools::Config.instance.queue_from)
|
19
19
|
rabbit.prefetch(1)
|
20
20
|
reply.bind(binding).subscribe(opts_subs) do |info, prop, payload|
|
21
21
|
info_subscribe(info, prop, payload)
|
@@ -1,16 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# :reek:InstanceVariableAssumption
|
4
|
-
|
5
3
|
module RubyRabbitmqJanus
|
6
4
|
module Rabbit
|
7
5
|
module Listener
|
8
|
-
#
|
6
|
+
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
7
|
+
#
|
8
|
+
# This publisher don't post message. Is listen just an admin queue to
|
9
|
+
# Janus. By default is "from-janus-admin". It's a parameter in config
|
10
|
+
# to this gem.
|
9
11
|
class FromAdmin < From
|
10
12
|
private
|
11
13
|
|
14
|
+
def reply
|
15
|
+
rabbit.queue(Tools::Config.instance.queue_admin_from)
|
16
|
+
end
|
17
|
+
|
12
18
|
def subscribe_queue
|
13
|
-
reply = rabbit.queue(Tools::Config.instance.queue_admin_from)
|
14
19
|
rabbit.prefetch(1)
|
15
20
|
reply.bind(binding).subscribe(opts_subs) do |info, prop, payload|
|
16
21
|
info_subscribe(info, prop, payload)
|