ruby_rabbitmq_janus 2.7.2.pre.305 → 2.7.2.pre.306
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ada073a94271720abfa45438672e23973b22ff6b930d1d2ebec2c9f9213f3267
|
4
|
+
data.tar.gz: 17ca6cf68ae2f749a423519c87f62123c48a47fa222ee1e07a79756bde5ad4b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b383b65d014a7b2152860a0f402fb92c571d534635036bd07cb29860ca03094c8a6459732dcc223904328c29aa8c970b90697547673569af0d1b7ce7269bf0c3
|
7
|
+
data.tar.gz: 9d4edefbcdc02dc93ebd1acd7a1aa19db651ef148596abbe9b32fd03395c91a8dfe809e0b02134976cdc2d7ec6b597223cc036e434d55cd06f6ac852b7b6a505
|
data/Rakefile
CHANGED
@@ -4,7 +4,11 @@ require 'bundler/gem_tasks'
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
|
6
6
|
# Exclude all spec with type :thread
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |_t|
|
8
|
+
end
|
9
|
+
|
10
|
+
# Exclude all spec with type :thread
|
11
|
+
RSpec::Core::RakeTask.new(:classic) do |t|
|
8
12
|
t.rspec_opts = '--tag ~type:thread'
|
9
13
|
end
|
10
14
|
|
@@ -14,5 +18,5 @@ RSpec::Core::RakeTask.new(:concurrency) do |t|
|
|
14
18
|
end
|
15
19
|
|
16
20
|
task default: :spec
|
17
|
-
|
21
|
+
task request: :classic
|
18
22
|
task thread: :concurrency
|
@@ -37,7 +37,6 @@ module Rails
|
|
37
37
|
PROGRAM = console? ? 'console' : pg_name
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
40
|
# If you used gem config for manage your ENV variables uncomment this line
|
42
41
|
# @see https://rubygems.org/gems/config
|
43
42
|
Settings.reload!
|
@@ -57,7 +56,8 @@ Settings.reload!
|
|
57
56
|
# Reload env variable before start thread RRJ for
|
58
57
|
# listen events in RabbitMQ public queue.
|
59
58
|
# Load class manually.
|
60
|
-
# It's loaded after initializer so add
|
59
|
+
# It's loaded after initializer so add
|
60
|
+
# manually here the listener block.
|
61
61
|
RubyRabbitmqJanus::RRJAdmin.new
|
62
62
|
|
63
63
|
# Comment/Remove this line if RRJ listener public queue is executed
|
@@ -66,11 +66,12 @@ Settings.reload!
|
|
66
66
|
# Loading classes Actions to rails application
|
67
67
|
require 'actions'
|
68
68
|
|
69
|
-
# Send a block code to thread for manage
|
69
|
+
# Send a block code to thread for manage
|
70
|
+
# event given by Janus in public queue
|
70
71
|
Rails.configuration.after_initialize do
|
71
72
|
# If you don't want listen a standard queue, comment this block and
|
72
73
|
# "require 'actions'" also
|
73
|
-
|
74
|
-
RubyRabbitmqJanus::Janus::Concurrencies::Event.instance.run(&
|
74
|
+
act = RubyRabbitmqJanus::ActionEvents.new.actions
|
75
|
+
RubyRabbitmqJanus::Janus::Concurrencies::Event.instance.run(&act)
|
75
76
|
end
|
76
77
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
namespace :rrj do
|
4
4
|
namespace :delete do
|
5
5
|
desc 'Delete one instance in database and janus'
|
6
|
-
task :one_instance, [
|
6
|
+
task :one_instance, %i[instance session] => :environment do |_task, args|
|
7
7
|
tags = '[RubyRabbitmqJanus][rrj:delete:one_instance] '
|
8
8
|
timelaps = Time.now.utc
|
9
9
|
|
@@ -11,11 +11,11 @@ namespace :rrj do
|
|
11
11
|
"with session #{args[:session]}"
|
12
12
|
|
13
13
|
janus_instance = RubyRabbitmqJanus::Models::JanusInstance\
|
14
|
-
|
14
|
+
.find_by_session(args[:session])
|
15
15
|
|
16
|
-
janus_instance
|
16
|
+
janus_instance&.destroy
|
17
17
|
|
18
|
-
Rails.logger.info
|
18
|
+
Rails.logger.info "#{tags}Executed in #{Time.now.utc - timelaps} ms"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|