An open API service indexing awesome lists of open source software.

https://github.com/gammazero/ring

Fixed-size circular deque
https://github.com/gammazero/ring

circular-queue deque

Last synced: 2 months ago
JSON representation

Fixed-size circular deque

Awesome Lists containing this project

README

        

# ring
Fixed-size circular deque

## Description

Ring is a fixed-size circular queue, where items can be effiifiently added and removed from either end. The number of items that can be stored in the ring is set at creation, and if the capacity is exceeded the end of the Ring being added to overwrites the other end of the Ring.

## Generics

Ring uses generics to create a Ring that contains items of the type specified. To create a Ring that holds a specific type, provide a type argument to `New`. For example:
```go
stringRing := ring.New[string](10)
```