work_shaper 0.1.2 → 0.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/lib/work_shaper/manager.rb +2 -1
- data/lib/work_shaper/version.rb +1 -1
- data/lib/work_shaper/worker.rb +5 -7
- data/lib/work_shaper.rb +3 -0
- data/work_shaper.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd87f9d88041bc67137b36d582629575ec11bb992e3ff9de8611237cfdd56a3
|
4
|
+
data.tar.gz: 5c3ad4dee1e236c9c3ab59c15ccaf95716387c9ecaccbc7e45616d6465e8f350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf7d11372a4d8e69292a82729636fd8bad0bffd1bfa87eae270004648e9beb508ae9d446141cecf09798f306cc5af71a1acec7d9d1d81c09ae93fabf5aa70af
|
7
|
+
data.tar.gz: 25195a7ccafaa687d09967d9d9efa2f066edc9b89503b30d62d3e68877518a3c753065de67374de56acf05017731a586ef0a2516510815ebc9a23fa44aea5713
|
data/Gemfile
CHANGED
data/lib/work_shaper/manager.rb
CHANGED
@@ -98,7 +98,8 @@ module WorkShaper
|
|
98
98
|
total_acked: @total_acked,
|
99
99
|
in_flight: (@total_enqueued.to_i - @total_acked.to_i),
|
100
100
|
last_acked_offsets: @last_ack,
|
101
|
-
worker_count: @workers.keys.count
|
101
|
+
worker_count: @workers.keys.count,
|
102
|
+
offset_mgr: @offset_manager.status
|
102
103
|
})
|
103
104
|
if detailed
|
104
105
|
WorkShaper.logger.info(
|
data/lib/work_shaper/version.rb
CHANGED
data/lib/work_shaper/worker.rb
CHANGED
@@ -27,16 +27,14 @@ module WorkShaper
|
|
27
27
|
@thread_pool.post do
|
28
28
|
@work.call(message, partition, offset)
|
29
29
|
@on_done.call(message, partition, offset)
|
30
|
+
rescue => e
|
31
|
+
WorkShaper.logger.error("Error processing #{partition}:#{offset} #{e}")
|
32
|
+
WorkShaper.logger.error(e.backtrace.join(" > "))
|
33
|
+
@on_error.call(e, message, partition, offset)
|
34
|
+
ensure
|
30
35
|
@semaphore.synchronize do
|
31
36
|
(@completed_offsets[partition] ||= SortedSet.new) << offset
|
32
37
|
end
|
33
|
-
# @ack_handler.call(partition, offset)
|
34
|
-
rescue => e
|
35
|
-
puts("Error processing #{partition}:#{offset} #{e}")
|
36
|
-
puts(e.backtrace.join("\n"))
|
37
|
-
# logger.error("Acking it anyways, why not?")
|
38
|
-
@on_error.call(e, message, partition, offset)
|
39
|
-
# @ack_handler.call(partition, offset)
|
40
38
|
end
|
41
39
|
# rubocop:enable Style/RescueStandardError
|
42
40
|
end
|
data/lib/work_shaper.rb
CHANGED
data/work_shaper.gemspec
CHANGED
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
# Uncomment to register a new dependency of your gem
|
35
35
|
spec.add_dependency "sorted_set", "~> 1.0"
|
36
|
+
spec.add_dependency "concurrent-ruby", "~> 1.2"
|
36
37
|
|
37
38
|
# For more information and examples about making a new gem, check out our
|
38
39
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_shaper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2
|
4
|
+
version: 0.1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerry Fernholz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorted_set
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: concurrent-ruby
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.2'
|
27
41
|
description: WorkShaper was built to parallelize the work needed to process Kafka
|
28
42
|
messages.
|
29
43
|
email:
|