Skip to content

v0.4.0

Choose a tag to compare

@clipperhouse clipperhouse released this 23 Aug 17:56
· 11 commits to main since this release
2493707

Wait methods are expanded and simplified. A Wait method automatically retries rejected requests until tokens are available, or the passed context has been cancelled.

Changes:

  • We removed the best-effort FIFO ordering. Wait methods now offer no ordering guarantees, so the user must decide if Wait is appropriate for their application.

    “Best effort” turns out to be a synonym for “unpredictable”: it would offer ordering 90% of the time, but then sometimes not. I believe this is worse than simply offering no promise.

  • Under the hood, we now use a sync.Mutex instead of sync.RWMutex. I believe the concurrent reads were not offering much, or perhaps any, advantage. sync.Mutex is a smaller and simpler type.

Additions:

  • Wait, WaitWithDetails and WaitWithDebug are now offered on Limiter and Limiters.