ax(mining): replace prose comments with usage examples on writePump/readPump
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:
parent
225d5c0216
commit
ff7acab30e
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue