diff --git a/pkg/event/define.go b/pkg/event/define.go index 3604c9c..8921901 100644 --- a/pkg/event/define.go +++ b/pkg/event/define.go @@ -18,7 +18,7 @@ type EventWorkFunc func() (interface{}, error) type DriverInterface interface { Get() *Event Put(event *Event) - GetLengthJudge() bool + GetLength() int } type ProduceInterface interface { diff --git a/pkg/event/driver.go b/pkg/event/driver.go index 78797ea..764ff22 100644 --- a/pkg/event/driver.go +++ b/pkg/event/driver.go @@ -137,12 +137,8 @@ func (d *Driver) Put(event *Event) { d.queue <- event } -func (d *Driver) GetLengthJudge() bool { - // 自动对当前的最大io数量进行判断 - if len(d.queue) > d.maxQueueSize * 1/2{ - return true - } - return false +func (d *Driver) GetLength() int { + return len(d.queue) } // NewDriver 新建 Driver