SkillAgentSearch skills...

Goworkqueue

Super simple, concurrent worker queue in golang

Install / Use

/learn @xeoncross/Goworkqueue
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GoWorkQueue

Super simple single-node job queue with managed workers. Perfect for small jobs like digesting streams or simple crawl jobs.

No race conditions and has a graceful shutdown.

Install

go get github.com/xeoncross/goworkqueue

Usage

Create a new queue instance with a callback for each job you want run.

queue := goworkqueue.NewQueue(1000, 5, func(job interface{}, workerID int) {
  fmt.Println("Processing", job)
})
queue.Add("one")  // anything can add "jobs" to process
queue.Run()       // Blocks until queue.Close() is called

See the example/example.go for more information.

Released Free under the MIT license http://davidpennington.me

View on GitHub
GitHub Stars68
CategoryDevelopment
Updated1y ago
Forks7

Languages

Go

Security Score

65/100

Audited on Feb 23, 2025

No findings