You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/example/kmq/consumer/queue.go

21 lines
268 B
Go

package main
import (
"fmt"
"zero/core/conf"
"zero/kq"
)
func main() {
var c kq.KqConf
conf.MustLoad("config.json", &c)
q := kq.MustNewQueue(c, kq.WithHandle(func(k, v string) error {
fmt.Printf("=> %s\n", v)
return nil
}))
defer q.Stop()
q.Start()
}