ing
This commit is contained in:
parent
5e7c06fad3
commit
19bd7a7b85
|
@ -20,6 +20,7 @@ type Client struct {
|
|||
Codec protocol.ClientCodec
|
||||
RPCInvoker registry.RPCInvoker
|
||||
Name string
|
||||
PendingRequests int
|
||||
|
||||
stopChan chan struct{}
|
||||
stopWg sync.WaitGroup
|
||||
|
@ -47,11 +48,16 @@ func (c *Client) Start() error {
|
|||
return fmt.Errorf("%s Codec is not valid", c.logHeader())
|
||||
}
|
||||
|
||||
if 0 >= c.PendingRequests {
|
||||
c.PendingRequests = 1024
|
||||
}
|
||||
|
||||
readChan, writeChan, err := c.Connector.Connect()
|
||||
if nil != err {
|
||||
return err
|
||||
}
|
||||
|
||||
c.requestQueueChan = make(chan *requestState, c.PendingRequests)
|
||||
c.stopChan = make(chan struct{})
|
||||
|
||||
c.stopWg.Add(1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user