Good day!
Is it possible to use one synchronizer with multiple windows and multiple limiters (ie: multiple clients)?
Pseudo code
synchronizer := NewNonBlockingSynchronizer()
for _, key := range keys {
limiter, stop := slidingwindow.NewLimiter(interval, rate, func() (slidingwindow.Window, slidingwindow.StopFunc) {
return slidingwindow.NewSyncWindow(key, synchronizer)
})
}
SyncWindow code always starts Synchronizer
however, in NonBlockingSynchronizer there are no checks for a double launch
So I suspect that the number of goroutines will be roughly equal to the number of limiters, that sounds quite overkill.
Is it a bug, feature, or I missed something?
Good day!
Is it possible to use one synchronizer with multiple windows and multiple limiters (ie: multiple clients)?
Pseudo code
SyncWindowcode always starts Synchronizerslidingwindow/window.go
Line 94 in 535bb99
however, in NonBlockingSynchronizer there are no checks for a double launch
slidingwindow/synchronizer.go
Line 131 in 535bb99
So I suspect that the number of goroutines will be roughly equal to the number of limiters, that sounds quite overkill.
Is it a bug, feature, or I missed something?