LastMessageBuffer

This is a specialized data structure designed to efficiently store and retrieve the last outbound messages sent to a client. It would be much easier to use a simple LinkedList, but that means we have to use iterators and create node objects, which causes large amounts of garbage collection considering the rate at which messages flow through the server.



This class operates like a circular buffer, but adds messages from back to front. By doing this, we can use System.aray copy to efficiently copy messages out, start with the newest first.

Constructors

Link copied to clipboard
constructor(max: Int)

Functions

Link copied to clipboard
Link copied to clipboard
fun fill(o: Array<V086Message?>, num: Int): Int
Link copied to clipboard