omq 0.30.0 → 0.30.1
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 +19 -0
- data/lib/omq/engine.rb +17 -2
- data/lib/omq/transport/ipc.rb +36 -0
- 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: cbb4225bd58846cc3ec28c008f11a4da2a3d0073be24ced5d6f4e99873b9cf91
|
|
4
|
+
data.tar.gz: 7e11730e874f7c24e4207d661c7e4efceb117b68c31b823b4cabdb5367cbd787
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e27866ec7266e32cee10ed0b70a651d9466018a9900b1754b32697962b845bb6abda645d36c307133739bee41536d99ac1cbf5f7156b02a32122b86b2e484b8a
|
|
7
|
+
data.tar.gz: 72970544ae442b3bf35e4ad95800d3d199ec6e72d376ce5fd8f573317e7e10bda51b2154bb68777c50a52e2df8e170756e1ff07e9b1e20cbe84012937b616956
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.30.1] - 2026-11-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `Engine.endpoint_uri(endpoint)`: the URI `#bind` and `#connect` return,
|
|
10
|
+
built by the transport when it has `.endpoint_uri`. The native backends use
|
|
11
|
+
it for the endpoints they resolve.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `#bind` and `#connect` return a URI that keeps the @ of an abstract IPC
|
|
16
|
+
name. They returned `ipc://name` for `ipc://@name`, because `URI.parse`
|
|
17
|
+
reads the @ as the end of an empty userinfo, and connecting to that dialed
|
|
18
|
+
a relative file path. Abstract names `URI.parse` rejects, such as ones with
|
|
19
|
+
spaces, no longer raise after the bind.
|
|
20
|
+
- `#bind` and `#connect` no longer raise for an IPC file path `URI.parse`
|
|
21
|
+
rejects, such as one with a space. They raised once the socket was already
|
|
22
|
+
bound or dialing.
|
|
23
|
+
|
|
5
24
|
## [0.30.0] - 2026-11-26
|
|
6
25
|
|
|
7
26
|
### Added
|
data/lib/omq/engine.rb
CHANGED
|
@@ -33,6 +33,21 @@ module OMQ
|
|
|
33
33
|
class << self
|
|
34
34
|
# @return [Hash{String => Module}] registered transports
|
|
35
35
|
attr_reader :transports
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# The URI {#bind} and {#connect} return for +endpoint+. A transport
|
|
39
|
+
# with +.endpoint_uri+ builds it: IPC keeps the @ of abstract names.
|
|
40
|
+
# The native backends use it for the endpoints they resolve.
|
|
41
|
+
#
|
|
42
|
+
# @param endpoint [String]
|
|
43
|
+
# @return [URI::Generic]
|
|
44
|
+
#
|
|
45
|
+
def endpoint_uri(endpoint)
|
|
46
|
+
transport = @transports[endpoint[/\A[^:]+/]]
|
|
47
|
+
return transport.endpoint_uri(endpoint) if transport.respond_to?(:endpoint_uri)
|
|
48
|
+
|
|
49
|
+
URI.parse(endpoint)
|
|
50
|
+
end
|
|
36
51
|
end
|
|
37
52
|
|
|
38
53
|
|
|
@@ -217,7 +232,7 @@ module OMQ
|
|
|
217
232
|
@listeners[listener.endpoint] = listener
|
|
218
233
|
remember_bind_alias(endpoint, listener.endpoint)
|
|
219
234
|
emit_monitor_event(:listening, endpoint: listener.endpoint)
|
|
220
|
-
|
|
235
|
+
Engine.endpoint_uri(listener.endpoint)
|
|
221
236
|
rescue => error
|
|
222
237
|
emit_monitor_event(:bind_failed, endpoint: endpoint, detail: { error: error })
|
|
223
238
|
raise
|
|
@@ -245,7 +260,7 @@ module OMQ
|
|
|
245
260
|
schedule_reconnect(endpoint, delay: 0)
|
|
246
261
|
end
|
|
247
262
|
|
|
248
|
-
|
|
263
|
+
Engine.endpoint_uri(endpoint)
|
|
249
264
|
end
|
|
250
265
|
|
|
251
266
|
|
data/lib/omq/transport/ipc.rb
CHANGED
|
@@ -14,6 +14,21 @@ module OMQ
|
|
|
14
14
|
Engine.transports["ipc"] = self
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
# The URI of an endpoint +URI.parse+ can't keep, with the path as
|
|
18
|
+
# given. +URI.parse+ reads the @ of "ipc://@name" as the end of an
|
|
19
|
+
# empty userinfo, so its #to_s is "ipc://name", a relative file path,
|
|
20
|
+
# and it rejects paths with spaces and similar characters.
|
|
21
|
+
#
|
|
22
|
+
class PathURI < URI::Generic
|
|
23
|
+
# @return [String] e.g. "ipc://@name"
|
|
24
|
+
#
|
|
25
|
+
def to_s
|
|
26
|
+
"ipc://#{path}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
|
|
17
32
|
class << self
|
|
18
33
|
# ZMTP connection class used for IPC-accepted/dialed peers.
|
|
19
34
|
#
|
|
@@ -124,9 +139,30 @@ module OMQ
|
|
|
124
139
|
end
|
|
125
140
|
|
|
126
141
|
|
|
142
|
+
# @param endpoint [String] e.g. "ipc:///tmp/my.sock" or "ipc://@abstract"
|
|
143
|
+
# @return [URI::Generic] the endpoint's URI; a {PathURI} for an
|
|
144
|
+
# abstract namespace name or a path +URI.parse+ rejects
|
|
145
|
+
#
|
|
146
|
+
def endpoint_uri(endpoint)
|
|
147
|
+
path = parse_path(endpoint)
|
|
148
|
+
return path_uri(path) if abstract?(path)
|
|
149
|
+
|
|
150
|
+
begin
|
|
151
|
+
URI.parse(endpoint)
|
|
152
|
+
rescue URI::InvalidURIError
|
|
153
|
+
path_uri(path)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
|
|
127
158
|
private
|
|
128
159
|
|
|
129
160
|
|
|
161
|
+
def path_uri(path)
|
|
162
|
+
PathURI.new("ipc", nil, nil, nil, nil, path, nil, nil, nil)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
|
|
130
166
|
# Connects to +path+ and hangs up. Raises ECONNREFUSED if nothing
|
|
131
167
|
# listens there.
|
|
132
168
|
#
|
data/lib/omq/version.rb
CHANGED