surfliner-metadata_consumer 0.1.0.pre.alpha.7 → 0.1.0.pre.alpha.8
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/CHANGES.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/surfliner/metadata_consumer/version.rb +1 -1
- data/lib/surfliner/mq/connection_config.rb +29 -2
- data/lib/surfliner/mq/queue_config.rb +24 -0
- data/lib/surfliner/mq/topic_config.rb +24 -0
- 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: f209e4cf680ce23da67c4caa19fd9448fed117ec03e38d54b50a382b1b6b72a0
|
4
|
+
data.tar.gz: 07a901ae1f7edda577c3cbd272aac1d68e7a31876ee536661b8586c55a0623d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5531263f0ddcac33d04d8ba55d9008b2e1562eda7288f49273631661038d1f61c858030bad5d6ec5dc8f51bd24f7e7ad34be5430eceba021ccfa21013771cece
|
7
|
+
data.tar.gz: 0f9d4c233b2b4be9410509772715c742e76717dbd5f124ca1b693965548d169f033734d262b67dfaa117246e6101a238f0b4894e20b5cfdfbc787c5865e18147
|
data/CHANGES.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -91,7 +91,7 @@ And `QueueConfig#from_env` similarly accepts keyword options, which are forwarde
|
|
91
91
|
|
92
92
|
```ruby
|
93
93
|
connection.with_topic(topic_config) do |topic|
|
94
|
-
queue_config = QueueConfig.from_env(exclusive: true, durable:
|
94
|
+
queue_config = QueueConfig.from_env(exclusive: true, durable: false)
|
95
95
|
queue = topic.bind_queue(queue_config)
|
96
96
|
# ...
|
97
97
|
end
|
@@ -28,7 +28,7 @@ module Surfliner
|
|
28
28
|
# @param port [String] RabbitMQ AMQP port
|
29
29
|
# @param username [String] RabbitMQ username
|
30
30
|
# @param password [String] RabbitMQ passsword
|
31
|
-
# @param await_response_on_close [Boolean] whether the RabbitMQ client should wait for a response when closing the connection
|
31
|
+
# @param await_response_on_close [Boolean, String] whether the RabbitMQ client should wait for a response when closing the connection
|
32
32
|
# @param opts [Hash] additional RabbitMQ conection options (see Bunny::Session#initialize)
|
33
33
|
def initialize(host:, port:, username:, password:, await_response_on_close: true, **opts)
|
34
34
|
@host = host
|
@@ -74,7 +74,34 @@ module Surfliner
|
|
74
74
|
@redacted_url ||= session_url.sub(password, "REDACTED")
|
75
75
|
end
|
76
76
|
|
77
|
-
|
77
|
+
# Whether `other` represents the same configuration as this object.
|
78
|
+
# Note that if any attributes or connection options are modified, equality becomes unstable.
|
79
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
80
|
+
def eql?(other)
|
81
|
+
self == other
|
82
|
+
end
|
83
|
+
|
84
|
+
# Whether `other` represents the same configuration as this object.
|
85
|
+
# Note that if any attributes or connection options are modified, equality becomes unstable.
|
86
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
87
|
+
def ==(other)
|
88
|
+
return unless other.class == self.class
|
89
|
+
other.options == options
|
90
|
+
end
|
91
|
+
|
92
|
+
# The hash value of this object. Equal configurations will have equal hash values.
|
93
|
+
# Note that if any attributes or connection options are modified, the hash value becomes unstable.
|
94
|
+
# @return [Integer] a hash value suitable for using equal configs as hash keys
|
95
|
+
def hash
|
96
|
+
options.hash
|
97
|
+
end
|
98
|
+
|
99
|
+
protected
|
100
|
+
|
101
|
+
# @return [Hash] all keyword arguments and connection options, for purposes of equality checking
|
102
|
+
def options
|
103
|
+
{host:, port:, username:, password:, await_response_on_close:, opts:}
|
104
|
+
end
|
78
105
|
|
79
106
|
def parse_boolean(v)
|
80
107
|
!FALSE_VALUES.include?(v.to_s)
|
@@ -15,6 +15,30 @@ module Surfliner
|
|
15
15
|
@options = options
|
16
16
|
end
|
17
17
|
|
18
|
+
# Whether `other` represents the same configuration as this object.
|
19
|
+
# Note that if `name` or `options` are modified, equality becomes unstable.
|
20
|
+
# @param other [Object, nil] the object to compare
|
21
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
22
|
+
def eql?(other)
|
23
|
+
self == other
|
24
|
+
end
|
25
|
+
|
26
|
+
# Whether `other` represents the same configuration as this object.
|
27
|
+
# Note that if `name` or `options` are modified, equality becomes unstable.
|
28
|
+
# @param other [Object, nil] the object to compare
|
29
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
30
|
+
def ==(other)
|
31
|
+
return unless other.class == self.class
|
32
|
+
other.name == name && other.options == options
|
33
|
+
end
|
34
|
+
|
35
|
+
# The hash value of this object. Equal configurations will have equal hash values.
|
36
|
+
# Note that if `name` or `options` are modified, the hash value becomes unstable.
|
37
|
+
# @return [Integer] a hash value suitable for using equal configs as hash keys
|
38
|
+
def hash
|
39
|
+
[name, options].hash
|
40
|
+
end
|
41
|
+
|
18
42
|
class << self
|
19
43
|
# Returns a default (environment-variable-based) configuration with the
|
20
44
|
# specified options.
|
@@ -15,6 +15,30 @@ module Surfliner
|
|
15
15
|
@options = options
|
16
16
|
end
|
17
17
|
|
18
|
+
# Whether `other` represents the same configuration as this object.
|
19
|
+
# Note that if `name` or `options` are modified, equality becomes unstable.
|
20
|
+
# @param other [Object, nil] the object to compare
|
21
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
22
|
+
def eql?(other)
|
23
|
+
self == other
|
24
|
+
end
|
25
|
+
|
26
|
+
# Whether `other` represents the same configuration as this object.
|
27
|
+
# Note that if `name` or `options` are modified, equality becomes unstable.
|
28
|
+
# @param other [Object, nil] the object to compare
|
29
|
+
# @return [Boolean] true if `other` represents the same configuration as this object, false otherwise
|
30
|
+
def ==(other)
|
31
|
+
return unless other.class == self.class
|
32
|
+
other.name == name && other.options == options
|
33
|
+
end
|
34
|
+
|
35
|
+
# The hash value of this object. Equal configurations will have equal hash values.
|
36
|
+
# Note that if `name` or `options` are modified, the hash value becomes unstable.
|
37
|
+
# @return [Integer] a hash value suitable for using equal configs as hash keys
|
38
|
+
def hash
|
39
|
+
[name, options].hash
|
40
|
+
end
|
41
|
+
|
18
42
|
class << self
|
19
43
|
# Returns a default (environment-variable-based) configuration with the
|
20
44
|
# specified options.
|