mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
33 lines
943 B
Go
33 lines
943 B
Go
package pulsarms
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/msgstream"
|
|
)
|
|
|
|
type Factory struct {
|
|
dispatcherFactory msgstream.ProtoUDFactory
|
|
address string
|
|
receiveBufSize int64
|
|
pulsarBufSize int64
|
|
}
|
|
|
|
func (f *Factory) NewMsgStream(ctx context.Context) (msgstream.MsgStream, error) {
|
|
return newPulsarMsgStream(ctx, f.address, f.receiveBufSize, f.pulsarBufSize, f.dispatcherFactory.NewUnmarshalDispatcher())
|
|
}
|
|
|
|
func (f *Factory) NewTtMsgStream(ctx context.Context) (msgstream.MsgStream, error) {
|
|
return NewPulsarTtMsgStream(ctx, f.address, f.receiveBufSize, f.pulsarBufSize, f.dispatcherFactory.NewUnmarshalDispatcher())
|
|
}
|
|
|
|
func NewFactory(address string, receiveBufSize int64, pulsarBufSize int64) *Factory {
|
|
f := &Factory{
|
|
dispatcherFactory: msgstream.ProtoUDFactory{},
|
|
address: address,
|
|
receiveBufSize: receiveBufSize,
|
|
pulsarBufSize: pulsarBufSize,
|
|
}
|
|
return f
|
|
}
|