Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lyrictian/queue
A task queue library for Go.
https://github.com/lyrictian/queue
go-queue go-task-queue queue task-queue
Last synced: 2 months ago
JSON representation
A task queue library for Go.
- Host: GitHub
- URL: https://github.com/lyrictian/queue
- Owner: LyricTian
- License: mit
- Created: 2017-09-12T06:00:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-12T23:57:03.000Z (over 2 years ago)
- Last Synced: 2024-10-02T09:05:46.718Z (3 months ago)
- Topics: go-queue, go-task-queue, queue, task-queue
- Language: Go
- Homepage: https://godoc.org/github.com/LyricTian/queue
- Size: 13.7 KB
- Stars: 33
- Watchers: 7
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# queue
> A task queue for mitigating server pressure in high concurrency situations and improving task processing.
[![Build][Build-Status-Image]][Build-Status-Url] [![Codecov][codecov-image]][codecov-url] [![ReportCard][reportcard-image]][reportcard-url] [![GoDoc][godoc-image]][godoc-url] [![License][license-image]][license-url]
## Get
``` bash
go get -u -v github.com/LyricTian/queue
```## Usage
``` go
package mainimport (
"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
``` text
Copyright (c) 2017 Lyric
```[License-Url]: http://opensource.org/licenses/MIT
[License-Image]: https://img.shields.io/npm/l/express.svg
[Build-Status-Url]: https://travis-ci.org/LyricTian/queue
[Build-Status-Image]: https://travis-ci.org/LyricTian/queue.svg?branch=master
[codecov-url]: https://codecov.io/gh/LyricTian/queue
[codecov-image]: https://codecov.io/gh/LyricTian/queue/branch/master/graph/badge.svg
[ReportCard-Url]: https://goreportcard.com/report/github.com/LyricTian/queue
[ReportCard-Image]: https://goreportcard.com/badge/github.com/LyricTian/queue
[GoDoc-Url]: https://godoc.org/github.com/LyricTian/queue
[GoDoc-Image]: https://godoc.org/github.com/LyricTian/queue?status.svg