mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Use buffered channels for new connections.
This commit is contained in:
parent
a9c1927b8d
commit
d604019909
1 changed files with 2 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ func (self *TcpTransport) Run() {
|
|||
case env := <-self.outbox:
|
||||
con, ok := self.connections[*(env.host)]
|
||||
if !ok {
|
||||
con = &connection{self, make(chan *db.Message), make(chan *db.Message), nil, env.host}
|
||||
con = &connection{self, make(chan *db.Message, 100), make(chan *db.Message, 100), nil, env.host}
|
||||
go con.manage()
|
||||
self.connections[*env.host] = con
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ func (self *TcpTransport) listen() {
|
|||
}
|
||||
|
||||
func (self *TcpTransport) manage(conn *net.Conn) {
|
||||
con := &connection{self, make(chan *db.Message), make(chan *db.Message), conn, nil}
|
||||
con := &connection{self, make(chan *db.Message, 100), make(chan *db.Message, 100), conn, nil}
|
||||
con.manage()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue