chore: add more tests (#2797)

* chore: add more tests

* chore: add more tests

* chore: add more tests
This commit is contained in:
Kevin Wan
2023-01-16 22:33:39 +08:00
committed by GitHub
parent a2df1bb164
commit 6d129e0264
5 changed files with 121 additions and 43 deletions

View File

@@ -69,10 +69,11 @@ func NewTimingWheel(interval time.Duration, numSlots int, execute Execute) (*Tim
interval, numSlots, execute)
}
return NewTimingWheelWithClock(interval, numSlots, execute, timex.NewTicker(interval))
return NewTimingWheelWithTicker(interval, numSlots, execute, timex.NewTicker(interval))
}
func NewTimingWheelWithClock(interval time.Duration, numSlots int, execute Execute,
// NewTimingWheelWithTicker returns a TimingWheel with the given ticker.
func NewTimingWheelWithTicker(interval time.Duration, numSlots int, execute Execute,
ticker timex.Ticker) (*TimingWheel, error) {
tw := &TimingWheel{
interval: interval,