Skip to content

refactor(irc): select directly over connection receivers#191

Merged
olivermrose merged 1 commit intomainfrom
refactor/irc-client-direct-select
May 3, 2026
Merged

refactor(irc): select directly over connection receivers#191
olivermrose merged 1 commit intomainfrom
refactor/irc-client-direct-select

Conversation

@olivermrose
Copy link
Copy Markdown
Collaborator

Replaces the per-connection forwarding task that repackaged ConnectionIncomingMessage into ClientLoopCommand::IncomingMessage with a StreamMap of UnboundedReceiverStream keyed by connection id, multiplexed into the client loop's main select!.

This removes the Weak<Sender> indirection used to break the forward-task <-> client-channel cycle, the tx_kill_incoming oneshot on PoolConnection, and the IncomingMessage command variant.

Assisted by Claude.

Copilot AI review requested due to automatic review settings May 3, 2026 01:35
@olivermrose olivermrose added lang: rust Items related to Rust scope: irc ai Content generated or heavily assisted by AI labels May 3, 2026
@olivermrose olivermrose force-pushed the refactor/irc-client-direct-select branch from 2ed4fad to 7313807 Compare May 3, 2026 01:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::IncomingMessage forwarding path with a StreamMap<usize, UnboundedReceiverStream<_>> multiplexed in the client loop.
  • Remove PoolConnection’s tx_kill_incoming oneshot and Drop impl used to terminate the forwarding task.
  • Add tokio-stream dependency to support StreamMap and UnboundedReceiverStream.

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.

@olivermrose olivermrose merged commit 62a0419 into main May 3, 2026
2 checks passed
@olivermrose olivermrose deleted the refactor/irc-client-direct-select branch May 3, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Content generated or heavily assisted by AI lang: rust Items related to Rust scope: irc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants