- Replace on_worker_connected() post-hoc call with WorkerConnectedCallback that fires inside CallAdapter::handle(). handle() blocks until disconnect — there is no 'after handle accepts' point for the assembly layer to hook into. The callback carries both on_connected (from_call + attach_peer) and on_disconnected (detach_peer + drop channels). - Add CallAdapter::with_worker_connected_callback(callback) builder method. - Consolidate duplicate WorkerConnectedCallback struct definitions. - Fix channel role: 'channel proxying' → 'channel management'. The hub tracks channels; it does not proxy streams. What the caller does with the resulting channel is the assembly layer's business. - Resolve OQ-54: callback is the committed design. Update OQ file and open-questions.md table.
1.1 KiB
OQ-54: Inbound Worker on_worker_connected Hook Placement
-
Origin: crates/hub/README.md
-
Status: resolved (2026-07-09)
-
Door type: Two-way
-
Priority: low
-
Resolution: The hook is a callback (
WorkerConnectedCallback) that fires insideCallAdapter::handle()between identity resolution and dispatch start.handle()blocks until disconnect — there is no "after handle accepts" point for the assembly layer to hook into. The callback carries bothon_connected(runsfrom_call, registers bundles, attaches peer to aggregated env) andon_disconnected(detaches peer, drops channel tracking onrun_loopexit). The callback is wired viaCallAdapter::with_worker_connected_callback(callback).The earlier "explicit post-hoc call" design (option a) was based on the incorrect assumption that
CallAdapter::handlereturns after accepting the connection. It doesn't — it runs the dispatch loop internally and returns only on disconnect. The callback approach is the correct design. -
Cross-references: ADR-067, ADR-068, crates/hub/README.md