forked from gitea/gitea
1
0
Fork 0
gitea/vendor/gitea.com/lunny/levelqueue
Lunny Xiao 38664d7f39 upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
..
.drone.yml upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
.gitignore upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
LICENSE upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
README.md upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
error.go upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
go.mod upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
go.sum upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00
queue.go upgrade levelqueue to 0.1.0 (#9192) (#9199) 2019-11-28 17:40:49 +01:00

README.md

levelqueue

Level queue is a simple queue golang library base on go-leveldb.

Build Status

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
})