Commit ce2998e
committed
perf(ipc): replace Mutex with channel-based writer task
Eliminate Arc<Mutex> contention in IPC listener by introducing a
dedicated writer task that exclusively owns the socket write half.
- Add WriteCommand enum for all write operations (Response, Heartbeat,
Push, SubscriptionResponse, DiscoveryResponse, StreamFrame)
- Add run_writer_task that processes commands from an MPSC channel
- Refactor handle_connection to spawn writer task and use channel
- Update push forwarder to send through channel instead of locking
- Extract process_frame and run_connection_loop for better structure
This eliminates lock contention between the main request loop and push
notification forwarder, improving throughput under concurrent load.1 parent 736519c commit ce2998e
1 file changed
+342
-115
lines changed
0 commit comments