What's New in v0.8.0
New Features
- Rate Limiter Middleware - Added a new middleware that provides pool-wide rate limiting using a token bucket algorithm
- Configure rate (requests/second) and burst capacity
- Blocks when rate limit exceeded (respects context cancellation)
- Shared across all workers in the pool
- Example:
middleware.RateLimiter[Task](10, 5) for 10 tasks/sec with burst of 5
Updates
- Go 1.24 - Updated minimum Go version to 1.24
- Dependencies - Updated golang.org/x/sync to v0.14.0, added golang.org/x/time v0.11.0
- CI/CD - Updated GitHub Actions workflow and golangci-lint-action from v3 to v7
- Linter Config - Migrated
.golangci.yml to v2 format for better maintainability
Bug Fixes
- Fixed logical error in batch overlap detection test
- Improved test timing tolerances to reduce CI flakiness
Documentation
- Updated README with rate limiting examples
- Enhanced middleware example to demonstrate rate limiting
- Normalized comment style throughout codebase
Improvements
- Code coverage increased by 0.2% to 94.482%
Usage Example
// Create pool with rate limiting
p := pool.New[string](5, worker).Use(
middleware.RateLimiter[string](10, 5), // 10 requests/sec with burst of 5
)
Full Changelog
v0.7.0...v0.8.0