zzq 0.1.0 → 0.1.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 +11 -0
- data/lib/zzq/engine.rb +8 -2
- data/lib/zzq/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: 87925e5f4e25692989436ea262564b72a644c7a03973bd381424fcc7658e1434
|
|
4
|
+
data.tar.gz: 2af870528ce076a739bd9095af5a628241c60aee97f4bf20037c7677b8c9e11c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69c572236412a029e78e65d792a0e489782b653fe52e36ab79d55efddf55aefe838689d7fd46428c00e43329c7b2c273e8626463306e330c9038cf4ba6aaa7a7
|
|
7
|
+
data.tar.gz: 56f03ad05f16d98a753fcc6d83af72b45bf607c369eaff62189a09aba8099df44d532d1ec39025a1ebd9efcc73cd54433c68728891e4f45951f6f2a453dfdbcd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.1.1 — 2026-04-20
|
|
4
|
+
|
|
5
|
+
- `Engine#handle_accepted` and `Engine#handle_connected` now return the
|
|
6
|
+
`ConnectionLifecycle` they just built (previously `nil`). This lets
|
|
7
|
+
frame-oriented out-of-tree transports such as
|
|
8
|
+
[`zzq-websocket`](https://github.com/paddor/zzq-websocket) attach
|
|
9
|
+
cancel-supervisors to the per-connection barrier so teardown
|
|
10
|
+
propagates into request/response fiber trees cleanly. Additive and
|
|
11
|
+
backwards-compatible — the existing `Engine#bind` call-site still
|
|
12
|
+
discards the return value.
|
|
13
|
+
|
|
3
14
|
## v0.1.0 — 2026-04-20
|
|
4
15
|
|
|
5
16
|
- First release. Async-native MQTT 3.1.1 + 5.0 client and broker in
|
data/lib/zzq/engine.rb
CHANGED
|
@@ -111,11 +111,14 @@ module ZZQ
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
# Called by transports for each accepted connection. Hands off to
|
|
114
|
-
# routing so the broker can read CONNECT / write CONNACK.
|
|
114
|
+
# routing so the broker can read CONNECT / write CONNACK. Returns
|
|
115
|
+
# the +ConnectionLifecycle+ so frame-oriented transports (e.g.
|
|
116
|
+
# WebSocket) can attach cancel-supervisors to its barrier.
|
|
115
117
|
def handle_accepted(io, endpoint:)
|
|
116
118
|
lifecycle = ConnectionLifecycle.new(self, endpoint: endpoint)
|
|
117
119
|
mqtt = lifecycle.begin_handshake!(io)
|
|
118
120
|
@routing.handle_accepted(mqtt, lifecycle) if @routing.respond_to?(:handle_accepted)
|
|
121
|
+
lifecycle
|
|
119
122
|
rescue => e
|
|
120
123
|
lifecycle.handshake_failed!(error: e)
|
|
121
124
|
raise unless e.is_a?(ConnectionRejected) || CONNECTION_LOST.any? { |c| e.is_a?(c) }
|
|
@@ -123,11 +126,14 @@ module ZZQ
|
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
# Called by transports for each dialed connection. Hands off to
|
|
126
|
-
# routing so the client can write CONNECT / read CONNACK.
|
|
129
|
+
# routing so the client can write CONNECT / read CONNACK. Returns
|
|
130
|
+
# the +ConnectionLifecycle+ so frame-oriented transports (e.g.
|
|
131
|
+
# WebSocket) can attach cancel-supervisors to its barrier.
|
|
127
132
|
def handle_connected(io, endpoint:)
|
|
128
133
|
lifecycle = ConnectionLifecycle.new(self, endpoint: endpoint)
|
|
129
134
|
mqtt = lifecycle.begin_handshake!(io)
|
|
130
135
|
@routing.handle_connected(mqtt, lifecycle) if @routing.respond_to?(:handle_connected)
|
|
136
|
+
lifecycle
|
|
131
137
|
rescue => e
|
|
132
138
|
lifecycle.handshake_failed!(error: e)
|
|
133
139
|
raise unless e.is_a?(ConnectionRejected) || CONNECTION_LOST.any? { |c| e.is_a?(c) }
|
data/lib/zzq/version.rb
CHANGED