omq 0.26.2 → 0.27.0
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 +13 -0
- data/lib/omq/engine/connection_lifecycle.rb +14 -7
- data/lib/omq/engine.rb +2 -1
- data/lib/omq/transport/ipc.rb +9 -0
- data/lib/omq/transport/tcp.rb +9 -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: 304adcf07ab3967251a821578bb96376b7c080e2a4d0d16430768ba6855b3557
|
|
4
|
+
data.tar.gz: 26babe478d3f2f07f8d011b2484083bc1c327a9938eaae0ab199bcdc560eaf55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 873f2817de7d8fb063da6b425982493012b4eff08b3035cf86fbce948e3398de34ca319713dc4b1f56e4556250a82b23510a304e5f3a503aa01b367c5e6c6379
|
|
7
|
+
data.tar.gz: 18df1029acefe76806a1e188e077aad0023ec52a5ae63b31aac09fbe450aec68c4c4688b88b8ae77c19669a30f53c418b65f9a728eb377562a5c74da34e1a8fd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.27.0 — 2026-04-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Transport-supplied ZMTP Connection class.** Transport modules may
|
|
8
|
+
now define `.connection_class` to substitute their own
|
|
9
|
+
`Protocol::ZMTP::Connection`-shaped class. `ConnectionLifecycle`
|
|
10
|
+
reads it (with a `respond_to?` fallback to
|
|
11
|
+
`Protocol::ZMTP::Connection`) so existing transports — built-in or
|
|
12
|
+
third-party — keep working unchanged. Enables plugin transports
|
|
13
|
+
whose wire shape differs from ZMTP/3.1 (e.g. ZeroMQ-over-WebSocket
|
|
14
|
+
per RFC 45) to plug in without forking the engine.
|
|
15
|
+
|
|
3
16
|
## 0.26.2 — 2026-04-20
|
|
4
17
|
|
|
5
18
|
### Fixed
|
|
@@ -66,13 +66,19 @@ module OMQ
|
|
|
66
66
|
# @param engine [Engine]
|
|
67
67
|
# @param endpoint [String, nil]
|
|
68
68
|
# @param done [Async::Promise, nil] resolved when connection is lost
|
|
69
|
+
# @param transport [Module, nil] transport module that produced +io+;
|
|
70
|
+
# queried for {.connection_class} so plugins (e.g. WebSocket) can
|
|
71
|
+
# substitute their own ZMTP-shaped connection class. Falls back to
|
|
72
|
+
# {Protocol::ZMTP::Connection} when nil or when the transport
|
|
73
|
+
# doesn't define +connection_class+.
|
|
69
74
|
#
|
|
70
|
-
def initialize(engine, endpoint: nil, done: nil)
|
|
71
|
-
@engine
|
|
72
|
-
@endpoint
|
|
73
|
-
@done
|
|
74
|
-
@
|
|
75
|
-
@
|
|
75
|
+
def initialize(engine, endpoint: nil, done: nil, transport: nil)
|
|
76
|
+
@engine = engine
|
|
77
|
+
@endpoint = endpoint
|
|
78
|
+
@done = done
|
|
79
|
+
@transport = transport
|
|
80
|
+
@state = :new
|
|
81
|
+
@conn = nil
|
|
76
82
|
|
|
77
83
|
# Nest the per-connection barrier under the socket-level barrier
|
|
78
84
|
# so every pump spawned via +@barrier.async+ is also tracked by
|
|
@@ -90,7 +96,8 @@ module OMQ
|
|
|
90
96
|
#
|
|
91
97
|
def handshake!(io, as_server:)
|
|
92
98
|
transition!(:handshaking)
|
|
93
|
-
|
|
99
|
+
conn_class = @transport.respond_to?(:connection_class) ? @transport.connection_class : Protocol::ZMTP::Connection
|
|
100
|
+
conn = conn_class.new io,
|
|
94
101
|
socket_type: @engine.socket_type.to_s,
|
|
95
102
|
identity: @engine.options.identity,
|
|
96
103
|
as_server: as_server,
|
data/lib/omq/engine.rb
CHANGED
|
@@ -635,7 +635,8 @@ module OMQ
|
|
|
635
635
|
def spawn_connection(io, as_server:, endpoint: nil)
|
|
636
636
|
@lifecycle.barrier&.async(transient: true, annotation: "conn #{endpoint}") do
|
|
637
637
|
done = Async::Promise.new
|
|
638
|
-
|
|
638
|
+
transport = endpoint ? transport_for(endpoint) : nil
|
|
639
|
+
lifecycle = ConnectionLifecycle.new(self, endpoint: endpoint, done: done, transport: transport)
|
|
639
640
|
lifecycle.handshake!(io, as_server: as_server)
|
|
640
641
|
done.wait
|
|
641
642
|
rescue Async::Stop, Async::Cancel
|
data/lib/omq/transport/ipc.rb
CHANGED
|
@@ -15,6 +15,15 @@ module OMQ
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class << self
|
|
18
|
+
# ZMTP connection class used for IPC-accepted/dialed peers.
|
|
19
|
+
#
|
|
20
|
+
# @return [Class]
|
|
21
|
+
#
|
|
22
|
+
def connection_class
|
|
23
|
+
Protocol::ZMTP::Connection
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
|
|
18
27
|
# Creates a bound IPC listener.
|
|
19
28
|
#
|
|
20
29
|
# @param endpoint [String] e.g. "ipc:///tmp/my.sock" or "ipc://@abstract"
|
data/lib/omq/transport/tcp.rb
CHANGED
|
@@ -13,6 +13,15 @@ module OMQ
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class << self
|
|
16
|
+
# ZMTP connection class used for TCP-accepted/dialed peers.
|
|
17
|
+
#
|
|
18
|
+
# @return [Class]
|
|
19
|
+
#
|
|
20
|
+
def connection_class
|
|
21
|
+
Protocol::ZMTP::Connection
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
|
|
16
25
|
# Creates a bound TCP listener.
|
|
17
26
|
#
|
|
18
27
|
# @param endpoint [String] e.g. "tcp://127.0.0.1:5555" or "tcp://*:0"
|
data/lib/omq/version.rb
CHANGED