ax(mining): replace prose comments with usage examples on writePump/readPump
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

RFC-025 §2: comments that restate what the function name already says
are deleted and replaced with concrete call-site examples showing
goroutine launch context and behaviour.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 14:23:36 +01:00
parent 225d5c0216
commit ff7acab30e
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -301,7 +301,7 @@ func NewEvent(eventType EventType, data interface{}) Event {
}
}
// writePump pumps messages from the hub to the websocket connection
// go client.writePump() // started by ServeWs; writes hub events to conn, sends ping every 30s
func (c *wsClient) writePump() {
ticker := time.NewTicker(30 * time.Second)
defer func() {
@ -341,7 +341,7 @@ func (c *wsClient) writePump() {
}
}
// readPump pumps messages from the websocket connection to the hub
// go client.readPump() // started by ServeWs; reads subscribe/ping messages from conn, unregisters on close
func (c *wsClient) readPump() {
defer func() {
c.hub.unregister <- c