feat: 升级接口约束以及定义
This commit is contained in:
21
abstract/IProducer.go
Normal file
21
abstract/IProducer.go
Normal 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 // 获取生产者处理器
|
||||
}
|
||||
Reference in New Issue
Block a user