Cultivating Developer-Centric DSLs
summary
Weedmaps ships a production Redis-backed limiter and a small DSL that exposes a memoized rate limiter and a clear class-level config (bucket, global and local rates). Code uses a blocking within_limit wrapper and an optional method_missing trick to support a rate_limited_ prefix, plus an “unlimited if no bucket or zero rate” fast path. Monitoring shows 429s drive design choices, global/local ordering gets flipped during rollout, and a gist with the implementation and knobs for retries and delays exists.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 2:27What is a DSL
- 4:33Rate limiters with demo
- 7:23Building DSL on rate limiter
- 9:50Local versus global rate limits
- 11:36Developer-centric DSL design
- 14:44Class-level rate limiter config
- 16:53Abstracting with within_rate_limit
- 17:15Metaprogramming rate-limited prefix
- 20:45Handling unlimited limits
- 22:53Lessons learned
- 27:06User-friendly error tracking
- 27:47Extending rate limiter DSL
- 30:37Q&A








