omq 0.28.4 → 0.28.6

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: 4a7d2541a2f4b738d4afc495979d3d9a6d36eb7dba15c16b69715a818d8a98c7
4
- data.tar.gz: 5237a3a57df244d8576565600192b056d74f9cc1538c613816906f19703a11e3
3
+ metadata.gz: ab1b687e71313324356754b6310952c84c996163db7907d1a3720a625c7c08e7
4
+ data.tar.gz: de2cc415b3b172b0f6fc766ffa94f037ac88fa5cdf8b20cb2d9dab24eb6b2f1c
5
5
  SHA512:
6
- metadata.gz: 6aab453842918ebec2116dd070ad83b79a82d410cd55f6c4f198e1fce8e06cc5b050f7a3b01baadb3d09249d489ad9c9236dff9d07c5a2e26b0e3781d7c44f75
7
- data.tar.gz: ef4e5e965f0aa20f9037e5bd7e782ac5fcce5bb1b939b3bf7f5b35c546ac8395a4b96670a67d0086fd0a0f201a8d3050efdb769c2f23f120316d4528607c64bc
6
+ metadata.gz: 1eb7301a2eb5523af9dc7e1cce62177a00b67c8882d861cdebd5ce4b8b69674014709dde7ac965f211f6e368acc63750fa4a12a355dcaa6dba1e386c9d39a6e0
7
+ data.tar.gz: 498561ceb534866f0280b081b3e99e9b8979415ea36dadb9e0613b04d699236ee2dc20d7af16b903d819a14b321d6c9410623cc10071a0b1b503293f22519738
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.28.6] - 2026-08-01
6
+
7
+ ### Changed
8
+
9
+ - Documented that the Rust backend exposes `zstd+tcp://`.
10
+
11
+ ## [0.28.5] - 2026-07-31
12
+
13
+ ### Fixed
14
+
15
+ - Recreated the shared background reactor after `fork`, avoiding inherited
16
+ queue/task state from the parent process.
17
+ - Applied `SUB` constructor subscriptions before connecting endpoints.
18
+
5
19
  ## [0.28.4] - 2026-07-30
6
20
 
7
21
  ### Fixed
data/README.md CHANGED
@@ -262,8 +262,8 @@ post-handshake message parts are compressed.
262
262
  training from early traffic. Use for new compressed TCP work.
263
263
  - **[omq-zstd](gems/omq-zstd)**: experimental `zstd+tcp://`.
264
264
  Zstandard per-part compression kept for research and comparison. Prefer
265
- `omq-lz4` for new compressed TCP work. OMQ.rs removed `zstd+tcp://`
266
- to reduce transport complexity after lz4rip gained dictionary training.
265
+ `omq-lz4` for new compressed TCP work. The Rust backend also exposes
266
+ `zstd+tcp://`.
267
267
 
268
268
  ### Protocol extensions (RFCs)
269
269
 
data/lib/omq/pub_sub.rb CHANGED
@@ -49,8 +49,8 @@ module OMQ
49
49
  subscribe: nil, on_mute: :block, backend: nil, &block)
50
50
  init_engine(:SUB, recv_hwm: recv_hwm, recv_timeout: recv_timeout,
51
51
  on_mute: on_mute, backend: backend)
52
- attach_endpoints(endpoints, default: :connect)
53
52
  self.subscribe(subscribe) unless subscribe.nil?
53
+ attach_endpoints(endpoints, default: :connect)
54
54
  finalize_init(&block)
55
55
  end
56
56
 
data/lib/omq/reactor.rb CHANGED
@@ -18,6 +18,7 @@ module OMQ
18
18
  THREAD_NAME = 'omq-io'
19
19
 
20
20
  @mutex = Mutex.new
21
+ @pid = nil
21
22
  @thread = nil
22
23
  @root_task = nil
23
24
  @work_queue = nil
@@ -36,16 +37,20 @@ module OMQ
36
37
  # @return [Async::Task]
37
38
  #
38
39
  def root_task
39
- return @root_task if @root_task
40
+ pid = Process.pid
41
+ return @root_task if @root_task && @pid == pid
42
+
43
+ reset_after_fork if @pid && @pid != pid
40
44
 
41
45
  @mutex.synchronize do
42
- return @root_task if @root_task
46
+ return @root_task if @root_task && @pid == pid
43
47
 
44
48
  ready = Thread::Queue.new
45
49
  @work_queue = Async::Queue.new
46
50
  @thread = Thread.new { run_reactor(ready) }
47
51
  @thread.name = THREAD_NAME
48
52
  @root_task = ready.pop
53
+ @pid = pid
49
54
 
50
55
  at_exit { stop! }
51
56
  end
@@ -108,6 +113,11 @@ module OMQ
108
113
  # @return [void]
109
114
  #
110
115
  def stop!
116
+ if @pid && @pid != Process.pid
117
+ reset_after_fork
118
+ return
119
+ end
120
+
111
121
  return unless @thread&.alive?
112
122
 
113
123
  max_linger = @lingers.empty? ? 0 : @lingers.keys.max
@@ -118,6 +128,7 @@ module OMQ
118
128
  @thread = nil
119
129
  @root_task = nil
120
130
  @work_queue = nil
131
+ @pid = nil
121
132
  @lingers.clear
122
133
  end
123
134
 
@@ -125,6 +136,16 @@ module OMQ
125
136
  private
126
137
 
127
138
 
139
+ def reset_after_fork
140
+ @mutex = Mutex.new
141
+ @thread = nil
142
+ @root_task = nil
143
+ @work_queue = nil
144
+ @pid = nil
145
+ @lingers.clear
146
+ end
147
+
148
+
128
149
  # Runs the shared Async reactor.
129
150
  #
130
151
  # Processes work items dispatched via {.run} while engine
data/lib/omq/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OMQ
4
- VERSION = "0.28.4"
4
+ VERSION = "0.28.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.4
4
+ version: 0.28.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger