A simple generic chan based queue worker
Please refer to LICENSE.md
package main
import (
queue "github.com/tcfw/go-queue"
)
type Processor struct {}
func (p *Processor) Handle(job interface{}) {
//Handle job...
}
func main() {
processor := &Processor{}
dispatcher := queue.NewDispatcher(processor)
dispatcher.Run()
}
package main
import (
queue "github.com/tcfw/go-queue"
)
type Processor struct {}
func (p *Processor) Handle(job interface{}) {
//Handle job...
}
func main() {
processor := &Processor{}
dispatcher := queue.NewDispatcher(processor)
//20 workers will be created
dispatcher.MaxWorkers = 20
dispatcher.Run()
}