Rate Limiting
Broadcast shares the global TokenBucket. Large volumes of emits within a frame are automatically throttled. Events that exceed the limit are silently dropped — no error is raised.
How it works
Broadcast rate limiting operates per player. When a client's token bucket is exhausted, additional emit calls targeting that player are dropped without an error or callback. The bucket refills automatically at the configured rate.
| Behaviour | Detail |
|---|---|
| Scope | Per-player token bucket, shared with the main App channel |
| On exceed | Silent drop — the emit is discarded, no error raised |
| EmitAll | Each player's bucket is checked independently |
| Custom limits | Move high-volume events to a dedicated Port with its own TokenBucket settings |
Per-event isolation with Ports
If you need per-event rate limits independent from the main channel, create a Port with its own TokenBucket settings. The Port's bucket is fully isolated — it cannot be drained by main-channel traffic.
-- Dedicated port for high-frequency position events
app:Listen("fx", function(port)
-- register routes here
end, {
maxTokens = 30,
refillRate = 15,
})
-- Client uses the named port for its Broadcast receives
local fxListener = RoExpress("Listener", "fx")
Choosing between Broadcast and Push
| Broadcast | Push | |
|---|---|---|
| Rate limited | Yes | No (server-initiated) |
| On rate exceed | Silent drop | Not applicable |
| Payload cap | 900 bytes | Roblox standard |
| Delivery guarantee | None | Guaranteed, ordered |
See also
← Broadcast · Fire Methods | Emit / EmitAll / EmitTo · TokenBucket | token bucket internals · Port Settings | per-port bucket configuration · Push | guaranteed delivery without rate limiting