gitflarePublicPartly agent-ready50
cf-durable-whiteboard
Realtime collaborative whiteboard on Cloudflare Durable Objects: presence cursors, WebSocket hibernation, SQLite storage, undo, PNG export.
- LicenseApache-2.0
- LanguageTypeScript
- Last landed
6eb4fbdOct 20, 2026
Keep board zoom and pan stable across reloads
6eb4fbdexport class TokenBucket { private tokens: number; private last: number; constructor(private rate = 60, private burst = 120, now = Date.now()) { this.tokens = burst; this.last = now; } take(now = Date.now()): boolean { this.tokens = Math.min(this.burst, this.tokens + ((now - this.last) / 1000) * this.rate); this.last = now; if (this.tokens >= 1) { this.tokens -= 1; return true; } return false; }}