queue

package module
v0.0.0-...-bbb3407 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 1 Imported by: 0

README

Queue

GoDoc Build Status codecov

A lock-free queue implement in Go using generics.

🎯 Features

  • ✅ Simple, lightweight without any external dependencies
  • ✅ Type-safe with Go generics (required Go 1.18)
  • ✅ Use with any Go data types, bool, int, string, structs or pointers

⚡️ Usage

import "github.com/goneric/queue"
type Queue[V any] interface {
	Push(value V)
	Pop() (value V, ok bool)
	Peek() (value V, ok bool)
	Len() int
}
Examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue[V any] interface {
	Push(value V)
	Pop() (value V, ok bool)
	// Peek() (value V, ok bool)
	Len() int
}

func New

func New[V any]() Queue[V]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL