mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
issue: #35917 Refines the pulsar-related mq APIs to allow the ctx to be passed down Signed-off-by: tinswzy <zhenyuan.wei@zilliz.com>
28 lines
699 B
Go
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()
|
|
}
|