voucher/internal/biz/mixrepos/send.go

17 lines
691 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package mixrepos
import (
"context"
"voucher/internal/pkg/mq"
)
type MQSendMixRepo interface {
// SendASync 异步发送消息,出错会自动写日志,errFn 中可以不用再写失败日志,可以处理一些数据纠正的操作等
SendASync(ctx context.Context, topicName string, body []byte, errFn func(error), sendOptions ...mq.SendOption) error
// SendSync 同步发布消息,不建议使用,性能低,会阻塞Producer,直到返回了才能响应下一个send
SendSync(ctx context.Context, topicName string, body []byte, sendOptions ...mq.SendOption) error
SendAsyncNotFn(ctx context.Context, topic string, body []byte, sendOptions ...mq.SendOption) error
}