https://github.com/zanjs/queue
https://github.com/zanjs/queue
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zanjs/queue
- Owner: zanjs
- License: mit
- Created: 2019-04-30T05:11:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T05:12:11.000Z (about 6 years ago)
- Last Synced: 2025-02-10T14:27:05.930Z (4 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- 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/zanjs/queue
```## Usage
``` go
package mainimport (
"fmt""github.com/zanjs/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) 2019 Julian
```[License-Url]: http://opensource.org/licenses/MIT
[License-Image]: https://img.shields.io/npm/l/express.svg
[Build-Status-Url]: https://travis-ci.org/zanjs/queue
[Build-Status-Image]: https://travis-ci.org/zanjs/queue.svg?branch=master
[codecov-url]: https://codecov.io/gh/zanjs/queue
[codecov-image]: https://codecov.io/gh/zanjs/queue/branch/master/graph/badge.svg
[ReportCard-Url]: https://goreportcard.com/report/github.com/zanjs/queue
[ReportCard-Image]: https://goreportcard.com/badge/github.com/zanjs/queue
[GoDoc-Url]: https://godoc.org/github.com/zanjs/queue
[GoDoc-Image]: https://godoc.org/github.com/zanjs/queue?status.svg