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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +2 -2
- data/lib/omq/pub_sub.rb +1 -1
- data/lib/omq/reactor.rb +23 -2
- data/lib/omq/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: ab1b687e71313324356754b6310952c84c996163db7907d1a3720a625c7c08e7
|
|
4
|
+
data.tar.gz: de2cc415b3b172b0f6fc766ffa94f037ac88fa5cdf8b20cb2d9dab24eb6b2f1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
266
|
-
|
|
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
|
-
|
|
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