omq-backend-rust 0.1.3 → 0.1.5
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 +15 -0
- data/ext/omq_backend_rust/Cargo.toml +1 -1
- data/ext/omq_backend_rust/src/options.rs +1 -1
- data/ext/omq_backend_rust/src/socket.rs +8 -0
- data/lib/omq/rust/engine.rb +6 -23
- data/lib/omq/rust/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: c552d7ca25d216c752732579deddf1cf357a8bd1b71cfec2be322f5e1d1645ef
|
|
4
|
+
data.tar.gz: 76e666f63269f5d69384aa04a6298144b78171c4f69d397a98ebfcb5ff1ccf9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a2974b9286be09db0671bf8784346e88bc58cbcdf00a3a22d58309a8a852e33164d044565315fcde4f869a11e3f294d38ed313f45196967259a1d2e46bfad81
|
|
7
|
+
data.tar.gz: e406b0651722cff4b807096ec15b5d8cb9cfd8e5e314285250af47ecaf119b79af3e0aa46265cab53e1b4d6b7ca6eea38f7b03cd31205ed0575d186dd43f9bff
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.1.5] - 2026-07-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Used `IO#wait_readable` for Rust backend receive waits and routed
|
|
10
|
+
`close_read` wakeups through the native receive notifier.
|
|
11
|
+
- Updated to `omq-tokio` 0.20.2, fixing large byte-stream `PUB` fan-out
|
|
12
|
+
delivery over IPC and TCP.
|
|
13
|
+
|
|
14
|
+
## [0.1.4] - 2026-07-30
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Accepted Ruby string identities when materializing Rust sockets.
|
|
19
|
+
|
|
5
20
|
## [0.1.3] - 2026-07-30
|
|
6
21
|
|
|
7
22
|
### Added
|
|
@@ -18,7 +18,7 @@ lz4 = ["omq-tokio/lz4"]
|
|
|
18
18
|
|
|
19
19
|
[dependencies]
|
|
20
20
|
omq-proto = { version = "=0.24.1", default-features = false }
|
|
21
|
-
omq-tokio = { version = "=0.20.
|
|
21
|
+
omq-tokio = { version = "=0.20.2", default-features = false }
|
|
22
22
|
tokio = { version = "1.52.0", features = ["rt", "rt-multi-thread", "time", "sync", "io-util", "net"] }
|
|
23
23
|
yring = { version = "0.3.8", features = ["async"] }
|
|
24
24
|
|
|
@@ -19,7 +19,7 @@ pub fn build_options(ruby: &Ruby, hash: RHash) -> Result<omq_tokio::Options, Err
|
|
|
19
19
|
Some(Duration::from_secs_f64(v))
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
if let Some(v) =
|
|
22
|
+
if let Some(v) = get_opt_bytes(ruby, hash, "identity")? {
|
|
23
23
|
if !v.is_empty() {
|
|
24
24
|
opts.identity = Bytes::from(v);
|
|
25
25
|
}
|
|
@@ -250,6 +250,13 @@ fn rust_socket_try_recv_batch(ruby: &Ruby, rb_self: &RustSocket) -> Result<Optio
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
fn rust_socket_wake_recv(rb_self: &RustSocket) {
|
|
254
|
+
let mat_guard = rb_self.materialized.read().unwrap();
|
|
255
|
+
if let Some(mat) = mat_guard.as_ref() {
|
|
256
|
+
mat.recv_notify.force_wake();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
253
260
|
fn rust_socket_recv_fd(ruby: &Ruby, rb_self: &RustSocket) -> Result<i32, Error> {
|
|
254
261
|
let mat_guard = rb_self.materialized.read().unwrap();
|
|
255
262
|
let mat = mat_guard
|
|
@@ -442,6 +449,7 @@ pub fn register(ruby: &Ruby) -> Result<(), Error> {
|
|
|
442
449
|
class.define_method("enqueue_send", method!(rust_socket_enqueue_send, 1))?;
|
|
443
450
|
class.define_method("try_recv", method!(rust_socket_try_recv, 0))?;
|
|
444
451
|
class.define_method("try_recv_batch", method!(rust_socket_try_recv_batch, 0))?;
|
|
452
|
+
class.define_method("wake_recv", method!(rust_socket_wake_recv, 0))?;
|
|
445
453
|
class.define_method("recv_fd", method!(rust_socket_recv_fd, 0))?;
|
|
446
454
|
class.define_method("send_fd", method!(rust_socket_send_fd, 0))?;
|
|
447
455
|
class.define_method(
|
data/lib/omq/rust/engine.rb
CHANGED
|
@@ -25,8 +25,6 @@ module OMQ
|
|
|
25
25
|
@on_io_thread = false
|
|
26
26
|
@materialized = false
|
|
27
27
|
@recv_sentinels = 0
|
|
28
|
-
@recv_sentinel_r = nil
|
|
29
|
-
@recv_sentinel_w = nil
|
|
30
28
|
|
|
31
29
|
@native = Native::RustSocket.new(socket_type.to_s)
|
|
32
30
|
|
|
@@ -104,25 +102,20 @@ module OMQ
|
|
|
104
102
|
return take_recv_sentinel if @recv_sentinels.positive?
|
|
105
103
|
|
|
106
104
|
loop do
|
|
107
|
-
|
|
105
|
+
@recv_signal_r.wait_readable
|
|
106
|
+
@recv_signal_r.read_nonblock(256, exception: false)
|
|
108
107
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
msg = try_recv_batch
|
|
112
|
-
return msg
|
|
113
|
-
end
|
|
108
|
+
msg = try_recv_batch
|
|
109
|
+
return msg if msg
|
|
114
110
|
|
|
115
|
-
if
|
|
116
|
-
@recv_sentinel_r.read_nonblock(256, exception: false)
|
|
117
|
-
return take_recv_sentinel if @recv_sentinels.positive?
|
|
118
|
-
end
|
|
111
|
+
return take_recv_sentinel if @recv_sentinels.positive?
|
|
119
112
|
end
|
|
120
113
|
end
|
|
121
114
|
|
|
122
115
|
|
|
123
116
|
def dequeue_recv_sentinel
|
|
124
117
|
@recv_sentinels += 1
|
|
125
|
-
@
|
|
118
|
+
@native.wake_recv if @materialized
|
|
126
119
|
nil
|
|
127
120
|
end
|
|
128
121
|
|
|
@@ -134,8 +127,6 @@ module OMQ
|
|
|
134
127
|
@peer_connected.resolve(nil) unless @peer_connected.resolved?
|
|
135
128
|
@all_peers_gone.resolve(nil) unless @all_peers_gone.resolved?
|
|
136
129
|
@subscriber_joined.resolve(nil) unless @subscriber_joined.resolved?
|
|
137
|
-
@recv_sentinel_r&.close rescue nil
|
|
138
|
-
@recv_sentinel_w&.close rescue nil
|
|
139
130
|
@native.close
|
|
140
131
|
end
|
|
141
132
|
|
|
@@ -183,7 +174,6 @@ module OMQ
|
|
|
183
174
|
@native.set_options(extract_options)
|
|
184
175
|
@native.materialize
|
|
185
176
|
@recv_signal_r = IO.for_fd(@native.recv_fd, autoclose: false)
|
|
186
|
-
ensure_recv_sentinel_pipe
|
|
187
177
|
@materialized = true
|
|
188
178
|
|
|
189
179
|
@routing.replay_pending(@native)
|
|
@@ -196,13 +186,6 @@ module OMQ
|
|
|
196
186
|
end
|
|
197
187
|
|
|
198
188
|
|
|
199
|
-
def ensure_recv_sentinel_pipe
|
|
200
|
-
return if @recv_sentinel_r
|
|
201
|
-
|
|
202
|
-
@recv_sentinel_r, @recv_sentinel_w = IO.pipe
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
|
|
206
189
|
def take_recv_sentinel
|
|
207
190
|
@recv_sentinels -= 1
|
|
208
191
|
nil
|
data/lib/omq/rust/version.rb
CHANGED