data_collector 0.41.0 → 0.41.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/data_collector/ext/base.rb +51 -47
- data/lib/data_collector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e47e1ddfa862a19d96aab23718b06aae7b0a84c9719a0662ea18ecae0f09c6b
|
4
|
+
data.tar.gz: 115717172899307b66783f1b8aa32615590d9fdf44d3d944cf532a5d9a941be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ee069f8134c3d90bc3832aaafd09812182f4b6e13f38dbbc18776d18f15f9de04f1d2d049ae61bb3b77fb2777a8fd33ce4ca933be546d83eac77a5d18baeae6
|
7
|
+
data.tar.gz: 83dfc12faa94aeb9aeecfd40be6c1ed74296f704f4650334dfc9099f6201671d4796c2166220160004c7fbb5a060ef09e5f29e9380c15fe953cae29931df8441
|
@@ -1,59 +1,63 @@
|
|
1
|
-
require '
|
1
|
+
require 'securerandom'
|
2
|
+
#require 'connection_pool'
|
2
3
|
|
3
4
|
module BunnyBurrow
|
4
|
-
class Connection
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
5
|
+
# class Connection
|
6
|
+
# include Singleton
|
7
|
+
# attr_reader :connection
|
8
|
+
# attr_accessor :verify_peer, :connection_name, :rabbitmq_url
|
9
|
+
#
|
10
|
+
# def connection
|
11
|
+
# unless @connection
|
12
|
+
# @connection = Bunny.new(@rabbitmq_url, verify_peer: @verify_peer, connection_name: @connection_name)
|
13
|
+
# @connection.start
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# @connection.start unless @connection.connected? || @connection.closed?
|
17
|
+
# #@connection.start if @connection.closed?
|
18
|
+
#
|
19
|
+
# #pp @connection.status
|
20
|
+
#
|
21
|
+
# @connection
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# def channel
|
25
|
+
# @channel = connection.create_channel unless @channel && @channel.open?
|
26
|
+
#
|
27
|
+
# @channel
|
28
|
+
# end
|
29
|
+
# end
|
29
30
|
|
30
31
|
class Base
|
31
32
|
attr_accessor(
|
32
33
|
:connection_name
|
33
34
|
)
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
def connection
|
38
|
-
Connection.instance.connection_name = @connection_name
|
39
|
-
Connection.instance.verify_peer = @verify_peer
|
40
|
-
Connection.instance.rabbitmq_url = @rabbitmq_url
|
41
|
-
|
42
|
-
unless @connection
|
43
|
-
@connection = Connection.instance.connection
|
44
|
-
@connection.start unless @connection.open?
|
45
|
-
end
|
46
|
-
|
47
|
-
@connection
|
48
|
-
end
|
49
|
-
|
50
|
-
def channel
|
51
|
-
Connection.instance.connection_name = @connection_name
|
52
|
-
Connection.instance.verify_peer = @verify_peer
|
53
|
-
Connection.instance.rabbitmq_url = @rabbitmq_url
|
54
|
-
|
55
|
-
@channel = Connection.instance.channel
|
36
|
+
def initialize
|
37
|
+
@connection_name = "#{Process.pid}-#{SecureRandom.uuid}"
|
56
38
|
end
|
39
|
+
# private
|
40
|
+
#
|
41
|
+
# def connection
|
42
|
+
# Connection.instance.connection_name = @connection_name
|
43
|
+
# Connection.instance.verify_peer = @verify_peer
|
44
|
+
# Connection.instance.rabbitmq_url = @rabbitmq_url
|
45
|
+
#
|
46
|
+
# unless @connection
|
47
|
+
# @connection = Connection.instance.connection
|
48
|
+
# @connection.start unless @connection.open?
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @connection
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# def channel
|
55
|
+
# Connection.instance.connection_name = @connection_name
|
56
|
+
# Connection.instance.verify_peer = @verify_peer
|
57
|
+
# Connection.instance.rabbitmq_url = @rabbitmq_url
|
58
|
+
#
|
59
|
+
# @channel = Connection.instance.channel
|
60
|
+
# end
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.41.
|
4
|
+
version: 0.41.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehmet Celik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|