refactor: channel reduction and terminology alignment#90
Merged
Conversation
NodeApi trait methods, handler structs, and REST/MCP function names now follow the same noun-verb pattern used by the management protocol and CLI/REPL (e.g. hint_set, route_del, peer_disconnect). OpenAPI operationIds updated to match (e.g. peersList, peerDisconnect, infoGet). Stale comments referencing old names cleaned up. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The role_transition_tx field was always None at every construction site. The RoleTransition message is still decoded and logged but no longer forwarded through a channel that nothing reads. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ctly The Pong handler in the control loop now calls registry.update_latency() directly instead of forwarding RTT measurements through a dedicated mpsc channel. This removes 4 channel pair creations (one per transport impl), the latency_rx field from ConnectResult/AcceptResult, and the latency_rx parameter from spawn_heartbeat. The peer name for registry lookups is extracted from the Handshake message — on the server side at construction, on the client side when the first Handshake arrives through the control stream. QuicClient and WsClient gain a peer_registry field that daemon modes set before calling connect(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract spawn_client_tasks() in client.rs — shared by both QUIC and WS connect paths. Handles the oneshot handshake channel, control stream task, data-in task, and ConnectResult construction that was previously copy-pasted across both transports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7aaf90d to
346d390
Compare
Extract spawn_server_tasks() in server.rs — resolves shared resources from ServerOptions, spawns the control loop with a Handler, and builds the AcceptResult. Replaces ~35 lines of identical setup in both QUIC and WS accept paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
info,hint_set,route_del,peer_disconnect)latency_tx/latency_rxchannel — Pong handler updates the peer registry directly instead of forwarding through an mpsc channelNonerole_transition_txfield fromControlChannelsHow to verify
cargo clippy --all-targets -- -D warnings— zero warnings on both default and slim buildscargo test -q— all tests pass including the rewritten ping latency testwallhack info/peers/pingall functionalinfo,peers,stats,ping,hint_set,hint_set_auto,route_delall respond correctly🤖 Generated with Claude Code