mirror of https://github.com/milvus-io/milvus.git
[skip ci]Fix golint error in allocator (#10130)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/10139/head
parent
40d3562ec0
commit
cfc9ba1e13
|
@ -31,21 +31,25 @@ const (
|
|||
maxConcurrentRequests = 10000
|
||||
)
|
||||
|
||||
// Request defines an interface which has Wait and Notify methods.
|
||||
type Request interface {
|
||||
Wait() error
|
||||
Notify(error)
|
||||
}
|
||||
|
||||
// BaseRequest implements Request interface.
|
||||
type BaseRequest struct {
|
||||
Done chan error
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Wait is blocked until the request is allocated or an error occurs.
|
||||
func (req *BaseRequest) Wait() error {
|
||||
err := <-req.Done
|
||||
return err
|
||||
}
|
||||
|
||||
// Notify is used to send error to the requester.
|
||||
func (req *BaseRequest) Notify(err error) {
|
||||
req.Done <- err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue