[skip ci]Fix golint error in allocator (#10130)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10139/head
zhenshan.cao 2021-10-18 21:29:00 +08:00 committed by GitHub
parent 40d3562ec0
commit cfc9ba1e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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
}