Skip to content

SafeQueue is low-level, in-memory, thread-safe, simple and fast FIFO queue in pure Go.

License

Notifications You must be signed in to change notification settings

valinurovam/safequeue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafeQueue Build Status Coverage Status Go Report Card GoDoc

SafeQueue is low-level, in-memory, thread-safe, simple and fast FIFO queue in pure Go.

Getting Started

Installing

$ go get -u github.com/valinurovam/safequeue

API

  • Push(item interface{})
  • PushHead(item interface{})
  • Pop() (item interface{})
  • Length() uint64
  • Purge()

Usage

Populate queue

queue := safequeue.NewSafeQueue(SIZE)
queueLength := SIZE * 8
for item := 0; item < queueLength; item++ {
    queue.Push(item)
}

Fetch items

item := queue.Pop()

Benchmarks

goos: darwin
goarch: amd64
pkg: github.com/valinurovam/safequeue
BenchmarkSafeQueue_Push-8       20000000               119 ns/op
BenchmarkSafeQueue_Pop-8        50000000               25.5 ns/op

License

SafeQueue source code is available under the MIT License.

About

SafeQueue is low-level, in-memory, thread-safe, simple and fast FIFO queue in pure Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages