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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ecbbe3094e3570604ee7b7b1b69d45d4a088c4da2dffb9c04a79d8b07475ac8
4
- data.tar.gz: 9daf51c7c1b2c7e30c33b306b5e4aad5440ef0af129f261951a13b74e30163af
3
+ metadata.gz: 87925e5f4e25692989436ea262564b72a644c7a03973bd381424fcc7658e1434
4
+ data.tar.gz: 2af870528ce076a739bd9095af5a628241c60aee97f4bf20037c7677b8c9e11c
5
5
  SHA512:
6
- metadata.gz: be9e2fa7e9159f333122b40b8776dfc659527d3c37153f7b94bc88eb3732e4fd11d4093e5cfb4366b105032a97bf9cda76334d019126d537dbb767b490586bd5
7
- data.tar.gz: c1d8ae054e97e5e9a5ec90c3a403933e59b5ae55e67b29a5bc65bd3df126719c990770e8f8563e29a76fe728ae14c27b0c2b7a6c6311a885ee2dc4d82a713b53
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZZQ
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zzq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger