ears 0.8.2 → 0.9.0

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: c7f0db6c78f5ce2d0271dbae56ef2200480127130d604168f701e6562bad0a19
4
- data.tar.gz: '03821a363301d6acc349e026cc5c152053ae8296ecc3f022f5f04b8572643e32'
3
+ metadata.gz: e7efe81a9b7a340a2f18828532f5b8833d88ffa1094bd5cef713c18e89282431
4
+ data.tar.gz: 6245d445274e10936fa39d9423e83f6d433f9533ce72503ea9141ece31686b4e
5
5
  SHA512:
6
- metadata.gz: 97e737054d37b2856e8184cebe1ff623ec7e6289989454c529fe840ab2f9ddcbabc55ccd382bba17e744f0fdaa59bb79aa387d3119bf5b478dd4180b824c4482
7
- data.tar.gz: 474208916ad8388c351e0a5c220dd6981b33c2d9f39775bfb4b9d8606e25eff38118b19003da28c00c250f7d1b99ebefaf749607cd17dee5cb4aba5960e2c6e9
6
+ metadata.gz: 4db3e60aa2b01c98ebf93d3edd08978cc2bb3d9eb069549fb26ad8c7ceafd384cb5bd7d0843ea4ad12e531f763a94f3764e194488cee488bc313802ad926706b
7
+ data.tar.gz: 915ff3b6aac612ac08a9db8d8ce4947c42e8dfff4be8927300ec0f135cc01e5891170f5a4260fb1bb70a13dc6afa3b6e5b6981593ed9400b2090a08451ad35e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 (2023-01-09)
4
+
5
+ - Add option to configure recover_from_connection_close
6
+
3
7
  ## 0.8.2 (2022-11-25)
4
8
 
5
9
  - default JSON middleware error handler to reject
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ears (0.8.2)
4
+ ears (0.9.0)
5
5
  bunny
6
6
  multi_json
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  amq-protocol (2.3.2)
12
12
  ast (2.4.2)
13
- bunny (2.19.0)
13
+ bunny (2.20.1)
14
14
  amq-protocol (~> 2.3, >= 2.3.1)
15
15
  sorted_set (~> 1, >= 1.0.2)
16
16
  diff-lcs (1.4.4)
@@ -20,7 +20,7 @@ GEM
20
20
  ast (~> 2.4.1)
21
21
  rainbow (3.0.0)
22
22
  rake (13.0.6)
23
- rbtree (0.4.5)
23
+ rbtree (0.4.6)
24
24
  redcarpet (3.5.1)
25
25
  regexp_parser (2.1.1)
26
26
  rexml (3.2.5)
@@ -54,7 +54,7 @@ GEM
54
54
  rubocop (~> 1.0)
55
55
  rubocop-ast (>= 1.1.0)
56
56
  ruby-progressbar (1.11.0)
57
- set (1.0.2)
57
+ set (1.0.3)
58
58
  sorted_set (1.0.3)
59
59
  rbtree
60
60
  set (~> 1.0)
@@ -65,6 +65,7 @@ PLATFORMS
65
65
  arm64-darwin-20
66
66
  arm64-darwin-21
67
67
  x86_64-darwin-20
68
+ x86_64-darwin-21
68
69
  x86_64-linux
69
70
 
70
71
  DEPENDENCIES
data/README.md CHANGED
@@ -30,6 +30,7 @@ require 'ears'
30
30
  Ears.configure do |config|
31
31
  config.rabbitmq_url = 'amqp://user:password@myrmq:5672'
32
32
  config.connection_name = 'My Consumer'
33
+ config.recover_from_connection_close = false, # optional configuration, defaults to true if not set
33
34
  end
34
35
  ```
35
36
 
@@ -12,6 +12,9 @@ module Ears
12
12
  # @return [String] the name for the RabbitMQ connection.
13
13
  attr_accessor :connection_name
14
14
 
15
+ # @return [Boolean] if the recover_from_connection_close value is set for the RabbitMQ connection.
16
+ attr_accessor :recover_from_connection_close
17
+
15
18
  def initialize
16
19
  @rabbitmq_url = DEFAULT_RABBITMQ_URL
17
20
  end
data/lib/ears/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ears
2
- VERSION = '0.8.2'
2
+ VERSION = '0.9.0'
3
3
  end
data/lib/ears.rb CHANGED
@@ -27,10 +27,7 @@ module Ears
27
27
  def connection
28
28
  @connection ||=
29
29
  Bunny
30
- .new(
31
- configuration.rabbitmq_url,
32
- connection_name: configuration.connection_name,
33
- )
30
+ .new(configuration.rabbitmq_url, **connection_config)
34
31
  .tap { |conn| conn.start }
35
32
  end
36
33
 
@@ -76,5 +73,15 @@ module Ears
76
73
  @configuration = nil
77
74
  Thread.current[:ears_channel] = nil
78
75
  end
76
+
77
+ private
78
+
79
+ def connection_config
80
+ {
81
+ connection_name: configuration.connection_name,
82
+ recover_from_connection_close:
83
+ configuration.recover_from_connection_close,
84
+ }.compact
85
+ end
79
86
  end
80
87
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Mainz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny