cosmonats 0.1.2 → 0.1.3
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/lib/cosmo/stream/processor.rb +4 -1
- data/lib/cosmo/version.rb +1 -1
- 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: 9c5a169718d8f3ddb85e2fcc95a5e1b6c0fd3061c1ad4410bd7bad85add934c6
|
|
4
|
+
data.tar.gz: aa9715564bdbead26f876ff9de8c9119084015fb3e0d52e2ec6b126c3d3ad0a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41bf7cc2664b566e0f70f9b4045a921abe7afc0e0cd33897f46dd975d4148aead93eaf7faeaffd7364268acee1713b08daeb151c7b124412de2983970787f97b
|
|
7
|
+
data.tar.gz: 761a89e2379601c71b75e6c13f63e0c7c0dda9fa7f5631aa6b0f8bab7493f3fe29bee1e562677be8f22ac45b1597f4a0f34660b91e999a7eceb7367d0db50d33
|
|
@@ -19,7 +19,7 @@ module Cosmo
|
|
|
19
19
|
setup_consumers
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def work_loop # rubocop:disable Metrics/CyclomaticComplexity
|
|
22
|
+
def work_loop # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
|
|
23
23
|
while running?
|
|
24
24
|
@consumers.each do |(subscription, config, processor)|
|
|
25
25
|
break unless running?
|
|
@@ -27,8 +27,11 @@ module Cosmo
|
|
|
27
27
|
begin
|
|
28
28
|
timeout = ENV.fetch("COSMO_STREAMS_FETCH_TIMEOUT", 0.1).to_f
|
|
29
29
|
@pool.post do
|
|
30
|
+
Logger.debug "fetching #{config.dig(:consumer, :subjects).inspect}, timeout=#{timeout}"
|
|
30
31
|
messages = fetch_messages(subscription, batch_size: config[:batch_size], timeout:)
|
|
32
|
+
Logger.debug "fetched (#{messages&.size.to_i}) messages"
|
|
31
33
|
process(messages, processor) if messages&.any?
|
|
34
|
+
Logger.debug "processed (#{messages&.size.to_i}) messages"
|
|
32
35
|
end
|
|
33
36
|
rescue Concurrent::RejectedExecutionError
|
|
34
37
|
break # pool doesn't accept new jobs, we are shutting down
|
data/lib/cosmo/version.rb
CHANGED