class documentation

class RequestRingBuffer(RingBuffer[JSON]):

Constructor: RequestRingBuffer(size)

View In Hierarchy

A ring buffer for requests.

This is used to store the last N requests in memory. It is used to retrieve the last requests for debugging purposes.

Method __init__ Initialize a ring buffer with a fixed size.

Inherited from RingBuffer:

Method __getitem__ Get an item from the buffer by index.
Method append Add an item to the ring buffer. If the buffer is full, the oldest item is removed.
Method incrementHead Increment the head in a circular manner.
Method nextIndex Increment an index in a circular manner without modifying the current index.
Instance Variable buffer The internal storage for the ring buffer, initialized with None values.
Instance Variable capacity The maximum number of items the buffer can hold.
Instance Variable head The current head index of the ring buffer, initialized to -1 indicating an empty buffer.
def __init__(self, size: int): ΒΆ

Initialize a ring buffer with a fixed size.

Parameters
size:intThe maximum number of items the buffer can hold.