Skip to content

CircularQueue with a custom index #15

@ghost

Description

The most important parameter for CircularQueue is definitly the maximum size.

const circularQueue = new CircularQueue<number>({
	maxSize: 4,
});

I have a use case, where I want to make it circular on two indexes !! Let me explain why this could be an amazing addition.

My case:

I have a stream of data that I want to limit analysis on say to 10k elements for processing time and the memory not to blow. (first index)
I also would like to take time into consideration, I want to limit also the size of the queue by the distance between minIndex and maxIndex where this new index is simply epoch. (my case is to only keep elements added since last week, earlier elements are not important at all).

I hope I could make it clear, and I would like to thank you Toreda.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions