Skip to content

Go package circularqueue implements a thread-safe circular queue

License

Notifications You must be signed in to change notification settings

Mottl/circularqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Thread-safe circular queue for Go

GoDoc

Installation

go get github.com/Mottl/circularqueue

Example

package main
  
import (
    "fmt"
    "github.com/Mottl/circularqueue"
)

func main() {
    queue := circularqueue.NewQueue(64)
    queue.Push(100)
    queue.Push(101)
    queue.Push(102)
    queue.Push(103)
    queue.PopAt(1)     // 101, nil
    queue.Pop()        // 103, nil
    fmt.Println(queue) // Queue (len=2, cap=64) [ 100, 102 ]
}

License

Use of this package is governed by MIT license that can be found in the LICENSE file.

About

Go package circularqueue implements a thread-safe circular queue

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages