voucher/internal/biz/thirdrepository/send.go

17 lines
696 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 thirdrepository
import (
"context"
"voucher/internal/pkg/mq"
)
type ThirdMQSend 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
}