ax(node): rename channel to responseChannel in handleResponse
AX Principle 1 — predictable names over short names. The variable `channel` in handleResponse required context to understand its role; `responseChannel` is self-describing on first read. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
511066b844
commit
ca3faa0144
1 changed files with 3 additions and 3 deletions
|
|
@ -45,15 +45,15 @@ func (ctrl *Controller) handleResponse(conn *PeerConnection, msg *Message) {
|
|||
}
|
||||
|
||||
ctrl.mutex.Lock()
|
||||
channel, exists := ctrl.pendingRequests[msg.ReplyTo]
|
||||
responseChannel, exists := ctrl.pendingRequests[msg.ReplyTo]
|
||||
if exists {
|
||||
delete(ctrl.pendingRequests, msg.ReplyTo)
|
||||
}
|
||||
ctrl.mutex.Unlock()
|
||||
|
||||
if exists && channel != nil {
|
||||
if exists && responseChannel != nil {
|
||||
select {
|
||||
case channel <- msg:
|
||||
case responseChannel <- msg:
|
||||
default:
|
||||
// Channel full or closed
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue