feat: index enhancement (close #2632 pr #2636)

* feat: index paths as setting

* feat: clear index (#2632)

* feat: check indexMQ more frequently
This commit is contained in:
BoYanZh
2022-12-09 10:02:13 +08:00
committed by GitHub
parent 1f7c1b4f43
commit 6f1aeb47fd
7 changed files with 63 additions and 2 deletions

View File

@ -18,6 +18,7 @@ type MQ[T any] interface {
Consume(BasicConsumer[T])
ConsumeAll(AllConsumer[T])
Clear()
Len() int
}
type inMemoryMQ[T any] struct {
@ -54,3 +55,7 @@ func (mq *inMemoryMQ[T]) Clear() {
defer mq.Unlock()
mq.queue.Clear()
}
func (mq *inMemoryMQ[T]) Len() int {
return mq.queue.Len()
}