messaging 4.0.1.pre → 4.0.3.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 890880412ffa587c9b553e88d7b9ccf192de0bc6d465629b2b81ab499affd239
4
- data.tar.gz: 73a9c88db9f865def6150d53001d37222ef1c05576f36250511fbf825482c0f1
3
+ metadata.gz: 1ca7a1f9acbfc6039457c0b8f7f271a70dd23c73894c9d8cfeb9f5ccba7ad125
4
+ data.tar.gz: 3fbdc20c27c5d2c8afb2574ea984f04023b2d6f3283ffe2c072d94f02f19fe87
5
5
  SHA512:
6
- metadata.gz: bb9fd10c0f1434ba2e129c7b9c71b302abd8164186b84f8b5db95ce9b76fd61b2f0052298f2abd33fa7b19cc916924aa42a02fec4254823c96eab7dd85b46255
7
- data.tar.gz: 4c1acafd63dc4dd6160813b0fb38f30aa597c70daf70b1c2703fc530fbfbf5905efff67ad19d811cb1696e4b4decc226c2b662f5b15c83c9795ae3583175f815
6
+ metadata.gz: 4434a696acc2a2018d943c2b78b9fdfda2d78216ab47ffb93c27a59c9df45c750ffdbdf23d26ef5e364da9c7408a732f420395d81bcf64f7e79d7a7652cb0ea6
7
+ data.tar.gz: f46171599d6ef0b1c317e251c4dcf7a28b08d376d616eca9d61b678e0af7e44dec1259619df0c35f689b60fd6d487fd1c358a3147de047d93a2e34be07341031
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- messaging (4.0.0.pre)
4
+ messaging (4.0.3.pre)
5
5
  activerecord
6
6
  activesupport
7
7
  after_transaction
@@ -44,6 +44,7 @@ module Messaging
44
44
 
45
45
  def process_messages
46
46
  while @running do
47
+ Meter.histogram('messaging.consumer.lag', unprocessed_messages_count, tags: { consumer: name })
47
48
  messages = fetch_messages
48
49
  messages.each do |message|
49
50
  process_message(message)
@@ -64,6 +65,10 @@ module Messaging
64
65
  sleep 5
65
66
  end
66
67
 
68
+ def unprocessed_messages_count
69
+ fetch_messages.count
70
+ end
71
+
67
72
  def fetch_messages
68
73
  SerializedMessage.in_category(categories)
69
74
  .with_transaction_id_lower_than_any_currently_running_transaction
@@ -1,3 +1,3 @@
1
1
  module Messaging
2
- VERSION = '4.0.1.pre'.freeze
2
+ VERSION = '4.0.3.pre'.freeze
3
3
  end
data/lib/messaging.rb CHANGED
@@ -5,7 +5,7 @@ require 'active_support'
5
5
  require 'active_support/notifications'
6
6
  require 'active_support/core_ext'
7
7
 
8
- if RUBY_VERSION == '2.3.8'
8
+ if RUBY_VERSION.split('.').first == '2'
9
9
  require 'messaging/config_23'
10
10
  else
11
11
  require 'messaging/config'
@@ -18,7 +18,7 @@ require 'messaging/exception_handler'
18
18
  require 'messaging/message'
19
19
  require 'messaging/message/from_json'
20
20
 
21
- if RUBY_VERSION == '2.3.8'
21
+ if RUBY_VERSION.split('.').first == '2'
22
22
  require 'messaging/routing_23'
23
23
  else
24
24
  require 'messaging/routing'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1.pre
4
+ version: 4.0.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bukowskis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord