RateLimiter

class RateLimiter(clock: Clock)(source)

Sliding-window rate limiter for AI-triggered operations.

Tracks the last maxCalls invocation timestamps. A new call is permitted only if fewer than maxCalls occurred within the windowDuration. This prevents aggregate AI traffic from flooding the mesh network.

The limiter is intentionally process-scoped and global so concurrent AI surfaces share a single airtime budget.

Constructors

Link copied to clipboard
constructor(clock: Clock)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Attempt to acquire a permit for one invocation.