A task queue for mitigating server pressure in high concurrency situations and improving task processing.
go get -u -v github.com/LyricTian/queue
package main
import (
"fmt"
"github.com/LyricTian/queue"
)
func main() {
q := queue.NewQueue(10, 100)
q.Run()
defer q.Terminate()
job := queue.NewJob("hello", func(v interface{}) {
fmt.Printf("%s,world \n", v)
})
q.Push(job)
// output: hello,world
}
Copyright (c) 2017 Lyric