/fifo

Primary LanguageGoMIT LicenseMIT

fifo

Go Reference CI Coverage Go Report Card

Thread safe GoLang fixed size FIFO with O(1) Get.

Example

import (
	"fmt"

	"github.com/floatdrop/fifo"
)

func main() {
	cache := fifo.New[string, int](256)

	cache.Push("Hello", 5)

	if e := cache.Get("Hello"); e != nil {
		fmt.Println(*e)
		// Output: 5
	}
}