bbk-amqp 1.0.0.105722 → 1.0.0.105731

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/bbk/amqp/utils.rb +7 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c548372181f2dd8188ed0aee86a514a0cf9d2d533d534211cd00d3e2137f1945
4
- data.tar.gz: 2afa60b894ff011b639ea8f1a9de931570feb4bbe2ddd6c2061474ac3d01f0a9
3
+ metadata.gz: 395701e78328d529b984fe2836575d4316da174c424db8a34a536d49e65e969e
4
+ data.tar.gz: 3dfa96c9ff17d85d42b937c244a03cce0576ccb78870a1fcc78cc9574132bd67
5
5
  SHA512:
6
- metadata.gz: 06be7f99a98d9a80a0414c2bc96ec4990fd6c50177ff89c8e8462b20a00e445449532008c70873e23f9b26102655858d0f35b80c1e9fbb89c4729ab1281cda56
7
- data.tar.gz: 1a9d618b0561e1fba5da9d23ad5c5000b2e66ef4e8a23657447968f74762539f249b98aecd307fd53fb2491d8adbeb1a10fdce2fca2d752ffe312cc76c7d1db0
6
+ metadata.gz: 7e9f0158659ad1a74276007c335f45ed9c0e914888e61c7b40674b2842b22da649c6d360a50c909a49c45ce578f0d5f27f6abce6941edf8ab84db5a3568ff4a8
7
+ data.tar.gz: 7d73afde4090357e76f85573864dbcd2b8d68953e5348a620eed5021822eb5bcb9cdebb92309af57a969ede68f1083d7dfe4167fd3dcf262ff13040a3eca3185
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-amqp (1.0.0.105722)
4
+ bbk-amqp (1.0.0.105731)
5
5
  activesupport (>= 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  bunny (>= 2.19.0)
@@ -16,6 +16,8 @@ module BBK
16
16
  unblocker = Queue.new
17
17
  consumed = false
18
18
  mx = Mutex.new
19
+ # Если сообщений несколько то порядок может поменяться и это нужно иметь в виду.
20
+ # Решить можно создав, отдельный канал с qos 1.
19
21
  consumer = queue.subscribe(block: false, manual_ack: true) do |delivery_info, metadata, payload|
20
22
  mx.synchronize do
21
23
  if consumed
@@ -40,9 +42,12 @@ module BBK
40
42
  unblocker << :timeout
41
43
  end
42
44
  result = unblocker.pop
43
- consumer.cancel
44
- raise ::Timeout::Error if result == :timeout
45
+ if result == :timeout
46
+ consumer.cancel
47
+ raise ::Timeout::Error
48
+ end
45
49
  queue.channel.ack(result[0].delivery_tag)
50
+ consumer.cancel
46
51
  result
47
52
  end
48
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbk-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.105722
4
+ version: 1.0.0.105731
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoylenko Yuri