v0.2.0
Additions:
- Now we can call
defer limiter.Kill()
to clean up or deactivate the limiter when it is not in use anymore. This will also kill the underlying goroutine and avoids resource leak. limiter.ShouldAllow(N uint64)
now returnsbool, error
.error
is notnil
ifShouldAllow
is called on a limiter that is killed or inactive.