Przeglądaj źródła

buffer the connection response channel

Buffer the channel which the IO goroutine sends the response
back to the stream handler so that the IO goroutine will not
block waiting for a slow stream handler.
Chris Bannister 10 lat temu
rodzic
commit
cd520c7d57
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      conn.go

+ 1 - 1
conn.go

@@ -180,7 +180,7 @@ func Connect(addr string, cfg ConnConfig, errorHandler ConnErrorHandler) (*Conn,
 	}
 	}
 
 
 	for i := 0; i < cfg.NumStreams; i++ {
 	for i := 0; i < cfg.NumStreams; i++ {
-		c.calls[i].resp = make(chan error)
+		c.calls[i].resp = make(chan error, 1)
 		c.uniq <- i
 		c.uniq <- i
 	}
 	}