mirror of
https://github.com/go-gitea/gitea.git
synced 2024-10-31 08:37:35 -04:00
.. | ||
.drone.yml | ||
.gitignore | ||
error.go | ||
go.mod | ||
go.sum | ||
LICENSE | ||
queue.go | ||
README.md |
levelqueue
Level queue is a simple queue golang library base on go-leveldb.
Installation
go get gitea.com/lunny/levelqueue
Usage
queue, err := levelqueue.Open("./queue")
err = queue.RPush([]byte("test"))
// pop an element from left of the queue
data, err = queue.LPop()
// if handle success, element will be pop, otherwise it will be keep
queue.LHandle(func(dt []byte) error{
return nil
})