RingBuffer<T>
classFixed-size circular buffer that overwrites the oldest entry on overflow.
Used by the hub to retain event history for late-connecting extensions.
The buffer pre-allocates an array of the given capacity and uses modular
arithmetic to track insertion position, making
push an O(1)
operation with no memory allocation after construction.Type parameters
| Name | Type | Description |
|---|---|---|
T | – | Item type stored in the buffer. |
Constructor
constructor
Properties
Methods
clear
Remove all items.
push
Push an item. Overwrites the oldest if at capacity.
toArray
Returns all items in insertion order (oldest first).