Increase default message channel from 200 -> 10k (#638)

This commit is contained in:
David Zhao
2022-04-20 16:34:00 -07:00
committed by GitHub
parent f699499220
commit 59112b9200
5 changed files with 16 additions and 11 deletions
+4 -2
View File
@@ -4,16 +4,18 @@ import (
"google.golang.org/protobuf/proto"
)
const DefaultMessageChannelSize = 200
type MessageChannel struct {
msgChan chan proto.Message
closed chan struct{}
onClose func()
}
func NewMessageChannel() *MessageChannel {
func NewMessageChannel(size int) *MessageChannel {
return &MessageChannel{
// allow some buffer to avoid blocked writes
msgChan: make(chan proto.Message, 200),
msgChan: make(chan proto.Message, size),
closed: make(chan struct{}),
}
}