ruby_rabbitmq_janus 2.5.1 → 2.6.0.pre.226
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/ruby_rabbitmq_janus +67 -0
- data/config/default.md +3 -0
- data/config/default.yml +6 -0
- data/lib/rrj/binary.rb +56 -0
- data/lib/rrj/errors/rabbit/base_event.rb +21 -0
- data/lib/rrj/errors/rabbit/listener/base.rb +29 -0
- data/lib/rrj/errors/rabbit/listener/from.rb +17 -0
- data/lib/rrj/errors/rabbit/listener/from_admin.rb +17 -0
- data/lib/rrj/errors/rabbit/listener/janus_instance.rb +17 -0
- data/lib/rrj/errors/rabbit/publisher/admin.rb +32 -0
- data/lib/rrj/errors/rabbit/publisher/base.rb +31 -0
- data/lib/rrj/errors/rabbit/publisher/exclusive.rb +33 -0
- data/lib/rrj/errors/rabbit/publisher/janus_instance.rb +23 -0
- data/lib/rrj/errors/rabbit/publisher/keepalive.rb +17 -0
- data/lib/rrj/errors/rabbit/publisher/non_exclusive.rb +33 -0
- data/lib/rrj/errors/rabbit/rabbit.rb +12 -6
- data/lib/rrj/info.rb +6 -5
- data/lib/rrj/init.rb +2 -2
- data/lib/rrj/janus/messages/message.rb +1 -1
- data/lib/rrj/janus/processus/event.rb +1 -1
- data/lib/rrj/janus/processus/keepalive/keepalive_thread.rb +3 -2
- data/lib/rrj/janus/responses/janus_instance.rb +28 -0
- data/lib/rrj/janus/responses/response.rb +1 -1
- data/lib/rrj/janus/transactions/admin.rb +1 -1
- data/lib/rrj/janus/transactions/handle.rb +1 -1
- data/lib/rrj/janus/transactions/transaction.rb +2 -2
- data/lib/rrj/models/concerns/janus_instance_callbacks.rb +9 -5
- data/lib/rrj/models/concerns/janus_instance_methods.rb +12 -0
- data/lib/rrj/rabbit/base_event.rb +47 -0
- data/lib/rrj/rabbit/connect.rb +12 -12
- data/lib/rrj/rabbit/{publish/listener.rb → listener/base.rb} +16 -18
- data/lib/rrj/rabbit/listener/from.rb +30 -0
- data/lib/rrj/rabbit/{publish/listener_admin.rb → listener/from_admin.rb} +6 -4
- data/lib/rrj/rabbit/listener/janus_instance.rb +36 -0
- data/lib/rrj/rabbit/{publish/publisher_admin.rb → publisher/admin.rb} +5 -10
- data/lib/rrj/rabbit/{publish/publisher.rb → publisher/base.rb} +10 -8
- data/lib/rrj/rabbit/{publish → publisher}/exclusive.rb +3 -3
- data/lib/rrj/rabbit/publisher/janus_instance.rb +27 -0
- data/lib/rrj/rabbit/{publish → publisher}/keepalive.rb +4 -2
- data/lib/rrj/rabbit/{publish → publisher}/non_exclusive.rb +3 -7
- data/lib/rrj/rabbit/rabbit.rb +1 -1
- data/lib/rrj/tools/gem/cluster.rb +0 -17
- data/lib/rrj/tools/gem/config.rb +9 -0
- data/lib/rrj/tools/gem/log.rb +3 -4
- data/lib/rrj/tools/gem/option.rb +2 -12
- data/lib/rrj/tools/replaces/admin.rb +4 -4
- data/lib/rrj/tools/replaces/handle.rb +6 -6
- data/lib/rrj/tools/replaces/replace.rb +6 -6
- data/lib/rrj/tools/replaces/session.rb +4 -4
- data/spec/factories/janus_instance.rb +1 -1
- data/spec/request/admin/request_allow_token_spec.rb +1 -0
- data/spec/request/admin/request_disallow_token_spec.rb +1 -0
- data/spec/request/admin/request_handle_info_spec.rb +1 -0
- data/spec/request/admin/request_list_handles_spec.rb +1 -0
- data/spec/request/admin/request_list_sessions_spec.rb +1 -0
- data/spec/request/admin/request_start_pcap_spec.rb +1 -0
- data/spec/request/admin/request_start_text2pcap_spec.rb +1 -0
- data/spec/request/admin/request_stop_pcap_spec.rb +1 -0
- data/spec/request/admin/request_stop_text2pcap_spec.rb +1 -0
- data/spec/request/base/request_attach_spec.rb +1 -1
- data/spec/request/base/request_create_spec.rb +2 -2
- data/spec/request/base/request_destroy_spec.rb +1 -1
- data/spec/request/base/request_detach_spec.rb +1 -1
- data/spec/request/base/request_info_spec.rb +2 -2
- data/spec/request/base/request_keepalive_spec.rb +1 -1
- data/spec/request/peer/request_offer_spec.rb +1 -1
- data/spec/request/peer/request_trickle_spec.rb +1 -1
- data/spec/request/peer/request_trickles_spec.rb +1 -1
- data/spec/rrj/{rrj_spec.rb → ruby_rabbitmq_janus_spec.rb} +21 -11
- data/spec/{thread/concurencies_spec.rb → ruby_rabbitmq_janus/janus/concurrencies/concurrency_spec.rb} +1 -1
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_initializer_spec.rb +3 -2
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_thread_spec.rb +3 -3
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_timer_spec.rb +1 -1
- data/spec/{rrj/messages/messages_admin_spec.rb → ruby_rabbitmq_janus/janus/messages/admin_spec.rb} +1 -1
- data/spec/{rrj/messages/messages_message_spec.rb → ruby_rabbitmq_janus/janus/messages/message_spec.rb} +2 -1
- data/spec/{rrj/messages/messages_standard_spec.rb → ruby_rabbitmq_janus/janus/messages/standard_spec.rb} +1 -1
- data/spec/{rrj/responses/responses_admin_spec.rb → ruby_rabbitmq_janus/janus/responses/admin_spec.rb} +1 -1
- data/spec/{rrj/responses/responses_event_spec.rb → ruby_rabbitmq_janus/janus/responses/event_spec.rb} +3 -2
- data/spec/{rrj/responses/responses_response_spec.rb → ruby_rabbitmq_janus/janus/responses/response_spec.rb} +3 -3
- data/spec/{rrj/responses/responses_standard_spec.rb → ruby_rabbitmq_janus/janus/responses/standard_spec.rb} +4 -3
- data/spec/{rrj → ruby_rabbitmq_janus}/models/janus_instance_definition_spec.rb +2 -2
- data/spec/{rrj/models/janus_instance_transaction_spec.rb → ruby_rabbitmq_janus/models/janus_instance_spec.rb} +10 -9
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/connect_spec.rb +1 -1
- data/spec/ruby_rabbitmq_janus/rabbit/listener/from_spec.rb +15 -0
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/propertie_2_spec.rb +3 -3
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/propertie_spec.rb +3 -3
- data/spec/ruby_rabbitmq_janus/rabbit/publisher/admin_spec.rb +12 -0
- data/spec/{rrj/rabbit/publish/base_publisher_spec.rb → ruby_rabbitmq_janus/rabbit/publisher/base_spec.rb} +3 -3
- data/spec/{rrj/rabbit/publish → ruby_rabbitmq_janus/rabbit/publisher}/exclusive_spec.rb +0 -0
- data/spec/{rrj/rabbit/publish → ruby_rabbitmq_janus/rabbit/publisher}/non_exclusive_spec.rb +0 -0
- data/spec/{rrj/tools/gem/rrj_cluster_spec.rb → ruby_rabbitmq_janus/tools/cluster_spec.rb} +1 -21
- data/spec/{rrj/tools/gem/rrj_config_spec.rb → ruby_rabbitmq_janus/tools/config_spec.rb} +26 -14
- data/spec/{rrj/tools/gem/rrj_log_spec.rb → ruby_rabbitmq_janus/tools/log_spec.rb} +10 -10
- data/spec/{rrj/tools/replace/replace_admin_spec.rb → ruby_rabbitmq_janus/tools/replaces/admin_spec.rb} +15 -15
- data/spec/{rrj/tools/replace/replace_handle_spec.rb → ruby_rabbitmq_janus/tools/replaces/handle_spec.rb} +14 -14
- data/spec/{rrj/tools/replace → ruby_rabbitmq_janus/tools/replaces}/replace_spec.rb +16 -17
- data/spec/{rrj/tools/replace/replace_session_spec.rb → ruby_rabbitmq_janus/tools/replaces/session_spec.rb} +14 -14
- data/spec/{rrj/tools/replace → ruby_rabbitmq_janus/tools}/type_spec.rb +19 -19
- data/spec/spec_helper.rb +1 -1
- data/spec/support/examples_request.rb +1 -1
- data/spec/support/type.rb +3 -3
- metadata +83 -59
- data/lib/rrj/errors/rabbit/publish/admin.rb +0 -30
- data/lib/rrj/errors/rabbit/publish/base_publisher.rb +0 -23
- data/lib/rrj/errors/rabbit/publish/exclusive.rb +0 -31
- data/lib/rrj/errors/rabbit/publish/listener.rb +0 -30
- data/lib/rrj/errors/rabbit/publish/non_exclusive.rb +0 -31
- data/lib/rrj/errors/rabbit/publish/publisher.rb +0 -38
- data/lib/rrj/rabbit/publish/base_publisher.rb +0 -50
- data/spec/rrj/rabbit/publish/admin_spec.rb +0 -12
- data/spec/rrj/rabbit/publish/listener_spec.rb +0 -15
- data/spec/rrj/rabbit/publish/publisher_spec.rb +0 -13
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyRabbitmqJanus
|
4
|
-
module Errors
|
5
|
-
module Rabbit
|
6
|
-
# Define a super class for all errors in Rabbit::Publisher::PublisherAdmin
|
7
|
-
class BasePublisherAdmin < BaseErrorPublisher
|
8
|
-
def initialize(message, level = :fatal)
|
9
|
-
super "[Admin] #{message}", level
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module PublisherAdmin
|
14
|
-
# Error for Rabbit::Publisher::PublisherAdmin#initialize
|
15
|
-
class Initialize < RubyRabbitmqJanus::Errors::Rabbit::BasePublisherAdmin
|
16
|
-
def initialize
|
17
|
-
super 'Error in initializer'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Error for Rabbit::Publisher::PublisherAdmin#publish
|
22
|
-
class Publish < RubyRabbitmqJanus::Errors::Rabbit::BasePublisherAdmin
|
23
|
-
def initialize
|
24
|
-
super 'Error for publish message'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyRabbitmqJanus
|
4
|
-
module Errors
|
5
|
-
module Rabbit
|
6
|
-
# Define a super class for all errors in Rabbit::Publisher::BasePublisher
|
7
|
-
class BaseErrorPublisher < BaseRabbit
|
8
|
-
def initialize(message, level = :fatal)
|
9
|
-
super "[Publisher] #{message}", level
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module BasePublisher
|
14
|
-
# Error for Rabbit::Publisher::BasePublisher#initialize
|
15
|
-
class Initialize < RubyRabbitmqJanus::Errors::Rabbit::BaseErrorPublisher
|
16
|
-
def initialize
|
17
|
-
super 'Error in initializer'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyRabbitmqJanus
|
4
|
-
module Errors
|
5
|
-
module Rabbit
|
6
|
-
# Define a super class for all errors in
|
7
|
-
# Rabbit::Publisher::PublishExclusive
|
8
|
-
class BasePublishExclusive < BaseErrorPublisher
|
9
|
-
def initialize(message, level = :fatal)
|
10
|
-
super "[Exclusive] #{message}", level
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module PublishExclusive
|
15
|
-
# Error for Rabbit::Publisher::PublishExclusive#initialize
|
16
|
-
class Initialize < Errors::Rabbit::BasePublishExclusive
|
17
|
-
def initialize
|
18
|
-
super 'Error in initializer'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# Error for Rabbit::Publisher::PublishExclusive#publish
|
23
|
-
class Publish < Errors::Rabbit::BasePublishExclusive
|
24
|
-
def initialize
|
25
|
-
super 'Error for publish message'
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyRabbitmqJanus
|
4
|
-
module Errors
|
5
|
-
module Rabbit
|
6
|
-
# Define a super class for all errors in Rabbit::Publisher::Listener
|
7
|
-
class BaseListener < BaseErrorPublisher
|
8
|
-
def initialize(message, level = :fatal)
|
9
|
-
super "[Listener] #{message}", level
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Listener
|
14
|
-
# Error for Rabbit::Publisher::Listener#initialize
|
15
|
-
class Initialize < RubyRabbitmqJanus::Errors::Rabbit::BaseListener
|
16
|
-
def initialize
|
17
|
-
super 'Error in initializer'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Error for Rabbit::Publisher::Listener#listen_events
|
22
|
-
class ListenEvents < RubyRabbitmqJanus::Errors::Rabbit::BaseListener
|
23
|
-
def initialize
|
24
|
-
super 'Error for listen events in RabbitMQ public queue'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyRabbitmqJanus
|
4
|
-
module Errors
|
5
|
-
module Rabbit
|
6
|
-
# Define a super class for all errors in
|
7
|
-
# Rabbit::Publisher::PublishNonExclusive
|
8
|
-
class BasePublishNonExclusive < BaseErrorPublisher
|
9
|
-
def initialize(message, level = :fatal)
|
10
|
-
super "[Non Exclusive] #{message}", level
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module PublishNonExclusive
|
15
|
-
# Error for Rabbit::Publisher::PublishNonExclusive#initialize
|
16
|
-
class Initialize < Errors::Rabbit::BasePublishNonExclusive
|
17
|
-
def initialize
|
18
|
-
super 'Error in initializer'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# Error for Rabbit::Publisher::PublishNonExclusive#publish
|
23
|
-
class Publish < Errors::Rabbit::BasePublishNonExclusive
|
24
|
-
def initialize
|
25
|
-
super 'Error for publish message'
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :reek:IrresponsibleModule
|
4
|
-
#
|
5
|
-
module RubyRabbitmqJanus
|
6
|
-
module Errors
|
7
|
-
module Rabbit
|
8
|
-
# Define a super class for all errors in Rabbit::Publisher::Publish
|
9
|
-
class BasePublish < BaseErrorPublisher
|
10
|
-
def initialize(message, level = :fatal)
|
11
|
-
super "[Publisher] #{message}", level
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module Publish
|
16
|
-
# Error for Rabbit::Publisher::Publish#initialize
|
17
|
-
class Initialize < RubyRabbitmqJanus::Errors::Rabbit::BasePublish
|
18
|
-
def initialize
|
19
|
-
super 'Error in initializer'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# Error for Rabbit::Publisher::Publish#publish
|
24
|
-
class Publish < RubyRabbitmqJanus::Errors::Rabbit::BasePublish
|
25
|
-
def initialize
|
26
|
-
super 'Error for publish message'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class TestCorrelation < RubyRabbitmqJanus::Errors::Rabbit::BasePublish
|
31
|
-
def initialize(message, propertie)
|
32
|
-
super "Response correlation ID mismatch (#{message} != #{propertie})", :fatal
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'semaphore'
|
4
|
-
|
5
|
-
module RubyRabbitmqJanus
|
6
|
-
module Rabbit
|
7
|
-
# Define an module for create an publisher
|
8
|
-
module Publisher
|
9
|
-
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
10
|
-
|
11
|
-
# # Parent class for all publisher
|
12
|
-
# This element send and read a message in rabbitmq Queue
|
13
|
-
#
|
14
|
-
# @!attribute [r] response
|
15
|
-
# @return [RubyRabbitmqJanus::Janus::Responses::Response]
|
16
|
-
# Given a Janus response
|
17
|
-
#
|
18
|
-
# @abstract Publish message in RabbitMQ
|
19
|
-
class BasePublisher
|
20
|
-
attr_reader :responses
|
21
|
-
|
22
|
-
# Define a base publisher
|
23
|
-
def initialize
|
24
|
-
@responses = []
|
25
|
-
@semaphore = Semaphore.new
|
26
|
-
@lock = Mutex.new
|
27
|
-
rescue
|
28
|
-
raise Errors::Rabbit::BasePublisher::Initialize
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
attr_accessor :semaphore, :lock
|
34
|
-
|
35
|
-
def return_response
|
36
|
-
@semaphore.wait
|
37
|
-
response = nil
|
38
|
-
@lock.synchronize do
|
39
|
-
response = @responses.shift
|
40
|
-
end
|
41
|
-
response
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
require 'rrj/rabbit/publish/publisher'
|
49
|
-
require 'rrj/rabbit/publish/listener'
|
50
|
-
require 'rrj/rabbit/publish/listener_admin'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe RubyRabbitmqJanus::Rabbit::Connect, type: :rabbit,
|
6
|
-
name: :publisher_admin do
|
7
|
-
let(:pusblish) { RubyRabbitmqJanus::Rabbot::Publisher::PublisherAdmin.new }
|
8
|
-
|
9
|
-
# @todo Complete test publisherAdmin
|
10
|
-
describe 'PublisherAdmin' do
|
11
|
-
end
|
12
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe RubyRabbitmqJanus::Rabbit::Publisher, type: :rabbit,
|
6
|
-
name: :listener do
|
7
|
-
let(:publish) do
|
8
|
-
rabbit = RubyRabbitmqJanus::Rabbit::Connect.new.rabbit
|
9
|
-
RubyRabbitmqJanus::Rabbit::Publisher::Listener.new(rabbit)
|
10
|
-
end
|
11
|
-
|
12
|
-
# @todo Complete spec publisher listener
|
13
|
-
describe 'Listener' do
|
14
|
-
end
|
15
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe RubyRabbitmqJanus::Rabbit::Publisher, type: :rabbit,
|
6
|
-
name: :publisher do
|
7
|
-
let(:publish) do
|
8
|
-
end
|
9
|
-
|
10
|
-
# @todo Complete spec publisher Publisher
|
11
|
-
describe 'Publisher' do
|
12
|
-
end
|
13
|
-
end
|