feat: 升级接口约束以及定义

This commit is contained in:
2026-04-13 17:04:21 +08:00
parent c232fe9317
commit ad44a84718
8 changed files with 195 additions and 0 deletions

21
abstract/IProducer.go Normal file
View File

@@ -0,0 +1,21 @@
// Package abstract ...
//
// Description : abstract ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2025-08-22 16:33
package abstract
import (
"context"
"git.zhangdeman.cn/zhangdeman/queue/define"
)
// IProducer 生产者接口约束
type IProducer interface {
Sync(ctx context.Context, data *define.EventData) // 同步发送事件
Async(ctx context.Context, data *define.EventData) // 异步发送事件
GetProducerHandler() IProducerHandler // 获取生产者处理器
}