ing
This commit is contained in:
parent
5e7c06fad3
commit
19bd7a7b85
|
@ -16,10 +16,11 @@ import (
|
|||
var uint64Type = reflect.TypeOf(uint64(0))
|
||||
|
||||
type Client struct {
|
||||
Connector csc.Connector
|
||||
Codec protocol.ClientCodec
|
||||
RPCInvoker registry.RPCInvoker
|
||||
Name string
|
||||
Connector csc.Connector
|
||||
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