racecar 3.0.0.alpha.1 → 3.0.0.alpha.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d48006d6ad7a9f1cb57902edbd8a2785f3e05c629a71c3345238a0841abeda6
4
- data.tar.gz: 06b557c5757e1c4bda2d1d6cebd2e679ab27053bc02f58636911f8df8d67f217
3
+ metadata.gz: 043070ffc30189dd4f500a691316db7a2a55422078b7bf5f31b81ff45aa69cab
4
+ data.tar.gz: 73a2d774f56f7f14d18c5c43691f185ab64fd7e2f3cd6a29dfcad8b9111f00b5
5
5
  SHA512:
6
- metadata.gz: 9e6cd591d16f776a84140105fd70eb565c70c6001ac03c5f61ea0ef45b40a8fd29e656a8da4b445894c87d9bb6002376364d8de896af481847222e4585b37374
7
- data.tar.gz: 6f1b2afeabde54e49e61ac8242b5a97daf3425f64bbe74bd3d0b69259a67d53a3113224273882779f6e12fc4bf97d1851169640c32a8ed56dcae6ce0b14a00f8
6
+ metadata.gz: d0ea838d6e6381660a88b6e1d71c95d0fbe741609dc216b18830d8a74eee78b0d56a6e05713b4f12ac28f60146b566f4f125d53b4c4bd4c52c3c13459941fac4
7
+ data.tar.gz: 213281a3b10ad91e3d7bcbf3a8974fbf15d8e1b5905518d3a4f13505ede101d254a433f86b1e7f875ccdad3c7d4d59fbc570b0d9db63f146615f4f454a65bd85
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (3.0.0.alpha.1)
4
+ racecar (3.0.0.alpha.3)
5
5
  king_konf (~> 1.0.0)
6
6
  rdkafka (>= 0.15.0)
7
7
 
@@ -194,7 +194,7 @@ module Racecar
194
194
  desc "Strategy for switching topics when there are multiple subscriptions. `exhaust-topic` will only switch when the consumer poll returns no messages. `round-robin` will switch after each poll regardless.\nWarning: `round-robin` will be the default in Racecar 3.x"
195
195
  string :multi_subscription_strategy, allowed_values: %w(round-robin exhaust-topic), default: "exhaust-topic"
196
196
 
197
- desc "Whether multithreaded processing is enabled"
197
+ desc "Enable multithreaded processing (one thread per partition). Set `RACECAR_MULTITHREADED_PROCESSING_ENABLED=1` to enable."
198
198
  boolean :multithreaded_processing_enabled, default: false
199
199
 
200
200
  desc "Max size of the queue of messages waiting to be processed when multithreaded processing is enabled"
@@ -70,6 +70,7 @@ module Racecar
70
70
 
71
71
  def close
72
72
  each_subscribed(&:close)
73
+ ensure
73
74
  reset_producer!
74
75
  end
75
76
 
@@ -20,7 +20,7 @@ module Racecar
20
20
  @consumer = consumer
21
21
  @rdkafka_consumer = rdkafka_consumer
22
22
 
23
- if config.multithreaded_processing_enabled
23
+ if @config.multithreaded_processing_enabled
24
24
  consumer_class_instance.configure(
25
25
  producer: consumer.producer,
26
26
  consumer: @consumer,
@@ -93,7 +93,7 @@ module Racecar
93
93
  end
94
94
 
95
95
  def resume_paused_partition
96
- return if config.pause_timeout == 0 || !pause.paused?
96
+ return if config.pause_timeout == 0
97
97
 
98
98
  @instrumenter.instrument("pause_status", {
99
99
  topic: topic,
@@ -127,7 +127,7 @@ module Racecar
127
127
  private
128
128
 
129
129
  def with_error_handling(messages, payload)
130
- if config.multithreaded_processing_enabled
130
+ if @config.multithreaded_processing_enabled
131
131
  with_multi_threaded_error_handling(messages, payload) { |pause| yield(pause) }
132
132
  else
133
133
  with_single_threaded_error_handling(messages, payload) { |pause| yield(pause) }
@@ -13,6 +13,11 @@ module Racecar
13
13
  class Runner
14
14
  attr_reader :consumer_class, :config, :logger, :partition_processors
15
15
 
16
+ # Kept for backward compatibility — external code calls `processor`.
17
+ def processor
18
+ @consumer_class_instance
19
+ end
20
+
16
21
  def initialize(consumer_class, config:, logger:, instrumenter: NullInstrumenter)
17
22
  @consumer_class, @config, @logger = consumer_class, config, logger
18
23
  @instrumenter = instrumenter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Racecar
4
- VERSION = "3.0.0.alpha.1"
4
+ VERSION = "3.0.0.alpha.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha.1
4
+ version: 3.0.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck