Source File
worker.go
Belonging Package
github.com/pancsta/asyncmachine-go/examples/asynq_fileprocessing/worker
package mainimport (tasks)const redisAddr = "127.0.0.1:6379"func main() {:= asynq.NewServer(asynq.RedisClientOpt{Addr: redisAddr},asynq.Config{// Specify how many concurrent workers to useConcurrency: 10,// Optionally specify multiple queues with different priority.Queues: map[string]int{"critical": 6,"default": 3,"low": 1,},// See the godoc for other configuration options},)// mux maps a type to a handler:= asynq.NewServeMux().HandleFunc(tasks.TypeFileProcessing, tasks.HandleFileProcessingTask)// ...register other handlers...if := .Run(); != nil {log.Fatalf("could not run server: %v", )}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |