cdc-parallel 0.2.1 → 0.2.2

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: 72b3b33568a37fa04b270edad8511a446703f115d78d86c2347c6af2e4be76a0
4
- data.tar.gz: e044e42d90f11b6b75b946ef0f1b1725f2810056be353a56342a908c139eb91c
3
+ metadata.gz: a51d304d55079509a1c2056573a9f4764924573b9a13eb1dbeda89ac94d57836
4
+ data.tar.gz: 4e154536aaca3d801d4affe02e424f332c6a1a37b738ee70cc8fea5f335645fd
5
5
  SHA512:
6
- metadata.gz: 3780fa1a616b33e824cff4f6c7f0ec8402085e5a742abbaa45082d1dc8ce6c7be04bd462aa78e4afcb61f7f9a3b0adab54ed4e47f972633c12348d57e65a632f
7
- data.tar.gz: 01ae9a18f4d8a6bab6c5f7e71333c38475a1930bdce6326e41bc9376100e74800cb850b22b8fda1de9638a2e78be3094a27bfd1b6592a6e868554ce933b471af
6
+ metadata.gz: c3002bfcd3914510fc39e7621fba99a7868303d24f8c8e5b849d40c653f73355b9926636ed6bb31754f2f028d65af325207eb89466923bc413eb8e44538730e7
7
+ data.tar.gz: 686ef1d6c0759d8ebedbd18e7109a4ac22008e8a0501faab31db8440bef3cf1127f79b076ce46fd3d8eec46f6e524e0ac6a75b1d3e0cefbc2f5ab151e99110b8
data/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
6
6
 
7
+ ## [0.2.2] - 2026-06-03
8
+
9
+ ### Changed
10
+
11
+ - Improved processor pool shutdown so workers are signaled and confirmed stopped where practical.
12
+ - Updated transaction processing so partial event failures fail the transaction result while preserving per-event results.
13
+ - Added CI validation for RBS signatures.
14
+
15
+ ### Added
16
+
17
+ - Added regression coverage for shutdown after processed and pending work.
18
+ - Added regression coverage for timeout-bounded shutdown behavior.
19
+ - Added regression coverage for `process_many([])` returning a clean empty result.
20
+ - Added transaction pool coverage for successful and partially failed transactions.
21
+
7
22
  ## [0.2.1] - 2026-06-03
8
23
 
9
24
  ### Added
@@ -63,6 +63,13 @@ module CDC
63
63
 
64
64
  @shutdown = true
65
65
 
66
+ signal_workers
67
+ wait_for_workers
68
+ end
69
+
70
+ private
71
+
72
+ def signal_workers
66
73
  @workers.each do |worker|
67
74
  worker.send(nil)
68
75
  rescue Ractor::ClosedError
@@ -70,7 +77,26 @@ module CDC
70
77
  end
71
78
  end
72
79
 
73
- private
80
+ def wait_for_workers
81
+ if @configuration.timeout
82
+ wait_for_workers_with_timeout
83
+ else
84
+ @workers.each(&:join)
85
+ end
86
+ end
87
+
88
+ def wait_for_workers_with_timeout
89
+ deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + @configuration.timeout
90
+
91
+ @workers.each do |worker|
92
+ remaining = deadline - Process.clock_gettime(Process::CLOCK_MONOTONIC)
93
+ break unless remaining.positive?
94
+
95
+ ::Timeout.timeout(remaining, TimeoutError) { worker.join }
96
+ rescue TimeoutError
97
+ break
98
+ end
99
+ end
74
100
 
75
101
  def validate_processor!(processor)
76
102
  return if processor.class.respond_to?(:ractor_safe?) &&
@@ -16,8 +16,12 @@ module CDC
16
16
  # @param transaction [CDC::Core::TransactionEnvelope]
17
17
  # @return [CDC::Core::ProcessorResult]
18
18
  def process(transaction)
19
- results = transaction.events.map { |event| @processor_pool.process(event) }.freeze
20
- ResultCollector.normalize(results)
19
+ results = @processor_pool.process_many(transaction.events).freeze
20
+ failure = results.find(&:failure?)
21
+
22
+ return CDC::Core::ProcessorResult.failure(failure.error, event: results) if failure
23
+
24
+ CDC::Core::ProcessorResult.success(results)
21
25
  end
22
26
 
23
27
  # Shut down worker resources.
@@ -3,6 +3,6 @@
3
3
  module CDC
4
4
  module Parallel
5
5
  # Current cdc-parallel version.
6
- VERSION = "0.2.1"
6
+ VERSION = "0.2.2"
7
7
  end
8
8
  end
@@ -37,6 +37,12 @@ module CDC
37
37
 
38
38
  private
39
39
 
40
+ def signal_workers: () -> untyped
41
+
42
+ def wait_for_workers: () -> untyped
43
+
44
+ def wait_for_workers_with_timeout: () -> untyped
45
+
40
46
  def validate_processor!: (untyped processor) -> (nil | untyped)
41
47
 
42
48
  def build_worker: (untyped processor) -> untyped
@@ -2,7 +2,7 @@ module CDC
2
2
  module Core
3
3
  class ProcessorResult
4
4
  def self.success: (untyped event) -> ProcessorResult
5
- def self.failure: (untyped error) -> ProcessorResult
5
+ def self.failure: (untyped error, ?event: untyped) -> ProcessorResult
6
6
  end
7
7
 
8
8
  class ChangeEvent
@@ -11,4 +11,4 @@ module CDC
11
11
  class TransactionEnvelope
12
12
  end
13
13
  end
14
- end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdc-parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken C. Demanawa