refactor(irc): select directly over connection receivers#191
Merged
olivermrose merged 1 commit intomainfrom May 3, 2026
Merged
refactor(irc): select directly over connection receivers#191olivermrose merged 1 commit intomainfrom
olivermrose merged 1 commit intomainfrom
Conversation
2ed4fad to
7313807
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the IRC client event loop to multiplex per-connection incoming message receivers directly in the main select!, removing the prior per-connection forwarding task and associated indirections.
Changes:
- Replace the
ClientLoopCommand::IncomingMessageforwarding path with aStreamMap<usize, UnboundedReceiverStream<_>>multiplexed in the client loop. - Remove
PoolConnection’stx_kill_incomingoneshot andDropimpl used to terminate the forwarding task. - Add
tokio-streamdependency to supportStreamMapandUnboundedReceiverStream.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src-tauri/src/irc/client/pool_connection.rs | Removes forwarding-task shutdown plumbing (tx_kill_incoming + Drop) from PoolConnection. |
| src-tauri/src/irc/client/mod.rs | Updates ClientLoopWorker::spawn callsite to new signature (no Weak sender). |
| src-tauri/src/irc/client/event_loop.rs | Introduces StreamMap-based multiplexing of connection incoming streams; removes IncomingMessage command variant and forward-task logic. |
| src-tauri/Cargo.toml | Adds tokio-stream dependency (with sync feature) for stream wrappers/multiplexing. |
| src-tauri/Cargo.lock | Locks tokio-stream and transitive dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Replaces the per-connection forwarding task that repackaged
ConnectionIncomingMessageintoClientLoopCommand::IncomingMessagewith aStreamMapofUnboundedReceiverStreamkeyed by connection id, multiplexed into the client loop's mainselect!.This removes the
Weak<Sender>indirection used to break the forward-task <-> client-channel cycle, thetx_kill_incomingoneshot onPoolConnection, and theIncomingMessagecommand variant.Assisted by Claude.