未验证 提交 cfc9ba1e 编写于 作者: Z zhenshan.cao 提交者: GitHub

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

Signed-off-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
上级 40d3562e
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册