LyricTian / queue

A task queue library for Go.

Home Page:https://godoc.org/github.com/LyricTian/queue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

queue

A task queue for mitigating server pressure in high concurrency situations and improving task processing.

Build Codecov ReportCard GoDoc License

Get

go get -u -v github.com/LyricTian/queue

Usage

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
}

MIT License

    Copyright (c) 2017 Lyric

About

A task queue library for Go.

https://godoc.org/github.com/LyricTian/queue

License:MIT License


Languages

Language:Go 100.0%