ruby_rabbitmq_janus 2.7.2.pre.319 → 2.7.2.pre.320

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9075316bbee0b7ce3abbeeaf84dc435debd54424ae480693c8d30c12bd2fefb
4
- data.tar.gz: d4af2c47fe67b807be34fd61331a9c1b2b7ae7663d5d5e44b12b7b88878d1f35
3
+ metadata.gz: fc50ee1b1b5ce39634a85050510221684d78a68cfb08947ae5e51ba60a492e3e
4
+ data.tar.gz: 3e95da4477afa9df8370611da6f25bae324770924d5a843727f0ad1b2af42e64
5
5
  SHA512:
6
- metadata.gz: cfd8a773ec40a3c57b4db55fa0593cc22b7e7721d57f1274cfee9f3da18ed5021d5f34ae83508155e15ecb4b0f05d1e4b76f1fd2ba2a5bc60f536904d479399f
7
- data.tar.gz: f004bdae8d19eb9b29ddf3ca37103501c6fc2de210bc839c819c9dae5bc01937d6c73a4f55edacf8d0ef6b77e5f775e645a2d24636c073a2d298bbdd91f8b5b5
6
+ metadata.gz: 1ec90884318b4edc421e7dd6bdf7de960001024f5f3179e09ac16787bb5ff6255165a644de050fd6ca90debf65cbea8c5295fa104a4a926084aa2b9db55915e6
7
+ data.tar.gz: 7af37d040a30723f419c992252d554f39ce85f19cfda389a1f652156422af9751706df12f9f92b49d8e5120a70c5b5fb5a31834731c5bc81be025c7e79cf806b
@@ -4,7 +4,7 @@ module RubyRabbitmqJanus
4
4
  module Process
5
5
  module Concurrencies
6
6
  # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
7
-
7
+ #
8
8
  # # Listen public queue to all Janus instance
9
9
  #
10
10
  # Listen standard queue and sending a block code to thread listen.
@@ -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
- # Manage admin message in queue public
9
- # Work In Progress
10
- class EventAdmin < Event
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
- # Listener to admin queue
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_rabbitmq_janus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2.pre.319
4
+ version: 2.7.2.pre.320
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy