Skip to content

feat!: receive parallels send — Client::onMessage delivers the default transport only - #23

Merged
genmon merged 2 commits into
mainfrom
feat/receive-parallels-send
Jul 29, 2026
Merged

genmon merged 2 commits into
mainfrom
feat/receive-parallels-send

Conversation

@genmon

@genmon genmon commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Breaking: Client::onMessage now fires only for messages arriving on the default transport — the receive-side mirror of Client::send(doc) routing to the default transport only. The guard is evaluated per dispatch, so a runtime setDefaultTransport() switch takes effect immediately. defaultTransport = null now closes the default lane in both directions.
  • Every other transport delivers via its per-transport hooks (onText/onBinary/MQTT's topic-aware onMessage), which become the receive path for non-default transports.
  • New: UdpTransport::onText(cb) — raw per-packet receive hook, same idiom as WebSocketTransport::onText (UDP previously had no per-transport receive path).
  • Version → 0.6.0-dev; changelog + CLAUDE.md updated.

Why

One rule in both directions: the default transport is the client-level lane; everything else is per-transport. This removes the aggregate-dispatch ambiguity that made multi-transport consumers filter by transport name, and it lets topic-aware consumers (e.g. MQTT topic routing in downstream layers) own their delivery without double-dispatch through the client callback. Groundwork for channel-based routing in Resident/Hawthorn (which needs MQTT consumed via its topic hook only).

Migration

Multi-transport users who relied on onMessage receiving all transports' messages should register per-transport hooks for the non-default transports (or setDefaultTransport to the lane they want at the client level). Downstream: Resident ≥0.7 defaults defaultTransport to "ws" when unset and a host is configured.

Tests

  • 4 new contract tests in test_client (default-only dispatch, per-transport hook delivery on non-default transports, runtime default switch, null-default closed lane); 4 pre-existing tests adapted to the new contract (no assertions weakened).
  • ./tools/run-tests.py unit: 163/163 pass; static-analysis clean.

🤖 Generated with Claude Code

genmon and others added 2 commits July 29, 2026 11:10
… parallels send)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@genmon
genmon merged commit 9e9520b into main Jul 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant