CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyrate-limiter

Python Rate-Limiter using Leaky-Bucket Algorithm for controlling request rates in applications with multiple backend storage options.

81

1.44x
Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates how well the engineer uses pyrate-limiter's async/await capabilities, specifically the try_acquire_async method and proper async limiter configuration. The focus is on correct usage of the library's async API for rate limiting in concurrent scenarios.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Limiter instantiation",
      "description": "Creates a Limiter instance with proper Rate configuration (e.g., Rate(5, Duration.SECOND) or equivalent)",
      "max_score": 15
    },
    {
      "name": "try_acquire_async usage",
      "description": "Uses try_acquire_async() method correctly to acquire permits before making requests, with proper await syntax",
      "max_score": 30
    },
    {
      "name": "Async bucket configuration",
      "description": "Uses an appropriate async-compatible bucket (e.g., InMemoryBucket, or async Redis bucket) rather than sync-only buckets",
      "max_score": 15
    },
    {
      "name": "Blocking behavior",
      "description": "Configures blocking=True (or uses default) in try_acquire_async to wait when rate limit is reached, rather than failing immediately",
      "max_score": 20
    },
    {
      "name": "Concurrent request handling",
      "description": "Uses asyncio.gather() or similar to handle multiple concurrent requests, properly awaiting try_acquire_async for each",
      "max_score": 15
    },
    {
      "name": "Identity/name parameter",
      "description": "Provides appropriate identity/name parameter to try_acquire_async to identify the rate-limited operation",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-pyrate-limiter

tile.json