Skip to content

Commit

Permalink
feat: thread-safe queue ring buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
amirvalhalla committed Jun 30, 2023
1 parent 2d6aa8d commit 3bd42b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Queue
=====

[![Build Status](https://github.com/eapache/queue/actions/workflows/golang-ci.yml/badge.svg)](https://github.com/eapache/queue/actions/workflows/golang-ci.yml)
[![GoDoc](https://godoc.org/github.com/eapache/queue?status.svg)](https://godoc.org/github.com/eapache/queue)
[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html)
A fast Golang queue using a ring-buffer, based on the version suggested by Dariusz Górecki. Using this instead of other, simpler, queue implementations (slice+append or linked list) provides substantial memory and time benefits, and fewer GC pauses.

* this repo instead of eapache/queue repo,is thread safe and handled errors
The v2 subfolder requires Go 1.18 or later and makes use of generics.

A fast Golang queue using a ring-buffer, based on the version suggested by Dariusz Górecki.
Using this instead of other, simpler, queue implementations (slice+append or linked list) provides
substantial memory and time benefits, and fewer GC pauses.
Follows semantic versioning using https://gopkg.in/ - import from gopkg.in/amirvalhalla/queue.v1 for guaranteed API stability.

The `v2` subfolder requires Go 1.18 or later and makes use of generics.

Follows semantic versioning using https://gopkg.in/ - import from
[`gopkg.in/eapache/queue.v1`](https://gopkg.in/eapache/queue.v1)
for guaranteed API stability.
### Usage:
```
go get -u https://github.com/amirvalhalla/queue
```


## Great Thanks
Enhanced and Improved (make thread-safe) from: [eapache/queue](https://github.com/eapache/queue)
2 changes: 1 addition & 1 deletion v2/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "errors"

import "sync"

// minQueueLen is smallest capacity that queue may have.
// minQueueLen is the smallest capacity that queue may have.
// Must be power of 2 for bitwise modulus: x % n == x & (n - 1).
const minQueueLen = 16

Expand Down

0 comments on commit 3bd42b1

Please sign in to comment.