Implement a thread-safe rate limiter that limits incoming API requests to a specified threshold per second.