mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-24 19:50:19 +08:00
17 lines
308 B
Go
17 lines
308 B
Go
package queue
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
)
|
|
|
|
// Push 推送队列
|
|
func Push(topic string, data interface{}) (err error) {
|
|
q, err := InstanceProducer()
|
|
if err != nil {
|
|
return
|
|
}
|
|
mqMsg, err := q.SendMsg(topic, gconv.String(data))
|
|
ProducerLog(ctx, topic, mqMsg.MsgId, err)
|
|
return err
|
|
}
|