RecvData and RecvAck are designed to be non-blocking and must remain so to prevent deadlock. They only enqueue work items to be processed asynchronously by the work queue's goroutine. These methods are called from the main RPC runServer loop, so blocking here would stall all RPC processing.
(dataPk wshrpc.CommandStreamData)
| 120 | // They only enqueue work items to be processed asynchronously by the work queue's goroutine. |
| 121 | // These methods are called from the main RPC runServer loop, so blocking here would stall all RPC processing. |
| 122 | func (b *Broker) RecvData(dataPk wshrpc.CommandStreamData) { |
| 123 | b.recvQueue.Enqueue(workItem{workType: "recvdata", dataPk: dataPk}) |
| 124 | } |
| 125 | |
| 126 | func (b *Broker) RecvAck(ackPk wshrpc.CommandStreamAckData) { |
| 127 | b.recvQueue.Enqueue(workItem{workType: "recvack", ackPk: ackPk}) |