milvus/pkg/mq/msgstream/wasted_mock_msgstream.go
tinswzy 5768dbbb5d
enhance: refine pular related mq interfaces (#38007)
issue: #35917 
Refines the pulsar-related mq APIs to allow the ctx to be passed down

Signed-off-by: tinswzy <zhenyuan.wei@zilliz.com>
2024-12-04 20:50:39 +08:00

28 lines
699 B
Go

package msgstream
import "context"
type WastedMockMsgStream struct {
MsgStream
AsProducerFunc func(channels []string)
BroadcastMarkFunc func(*MsgPack) (map[string][]MessageID, error)
BroadcastFunc func(*MsgPack) error
ChanFunc func() <-chan *MsgPack
}
func NewWastedMockMsgStream() *WastedMockMsgStream {
return &WastedMockMsgStream{}
}
func (m WastedMockMsgStream) AsProducer(ctx context.Context, channels []string) {
m.AsProducerFunc(channels)
}
func (m WastedMockMsgStream) Broadcast(ctx context.Context, pack *MsgPack) (map[string][]MessageID, error) {
return m.BroadcastMarkFunc(pack)
}
func (m WastedMockMsgStream) Chan() <-chan *MsgPack {
return m.ChanFunc()
}