(resp *proto.CoordinateResponse)
| 246 | } |
| 247 | |
| 248 | func (c *connIO) Enqueue(resp *proto.CoordinateResponse) error { |
| 249 | c.mu.Lock() |
| 250 | defer c.mu.Unlock() |
| 251 | if c.closed { |
| 252 | return xerrors.New("connIO closed") |
| 253 | } |
| 254 | select { |
| 255 | case <-c.peerCtx.Done(): |
| 256 | return c.peerCtx.Err() |
| 257 | case c.responses <- resp: |
| 258 | c.logger.Debug(c.peerCtx, "wrote response") |
| 259 | return nil |
| 260 | default: |
| 261 | return agpl.ErrWouldBlock |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | func (c *connIO) Name() string { |
| 266 | return c.name |