Documentation
¶
Index ¶
- Constants
- type AsyncConsumer
- func (p *AsyncConsumer) AsyncBatch(ctx context.Context, funcArgList []*mongodb.FunctionArg, ...)
- func (p *AsyncConsumer) AsyncOne(funcArg *mongodb.FunctionArg)
- func (p *AsyncConsumer) IsAsyncBatch() bool
- func (p *AsyncConsumer) IsAsyncOne() bool
- func (p *AsyncConsumer) Start()
- func (p *AsyncConsumer) Stop()
- func (p *AsyncConsumer) SwitchMode(mode uint32)
Constants ¶
View Source
const ModelAsyncBatch uint32 = 2 // 异步执行合并写
View Source
const ModelAsyncOne uint32 = 1 // 异步执行单条
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncConsumer ¶
type AsyncConsumer struct {
// contains filtered or unexported fields
}
AsyncConsumer DB异步操作消费者
var (
AsyncConsumerInstance *AsyncConsumer
)
func NewDbAsyncConsumer ¶
func NewDbAsyncConsumer(dm *mongodb.Mgr, drm *db_retry.DBRetryMgr, bench *bench.DBAsync, workerChan <-chan interface{}) *AsyncConsumer
func (*AsyncConsumer) AsyncBatch ¶
func (p *AsyncConsumer) AsyncBatch(ctx context.Context, funcArgList []*mongodb.FunctionArg, dbBatchMgr *db_batch.DbBatchMgr)
AsyncBatch 批量bulk write执行
func (*AsyncConsumer) AsyncOne ¶
func (p *AsyncConsumer) AsyncOne(funcArg *mongodb.FunctionArg)
AsyncOne 单条执行
func (*AsyncConsumer) IsAsyncBatch ¶
func (p *AsyncConsumer) IsAsyncBatch() bool
IsAsyncBatch 是否异步合并执行
Click to show internal directories.
Click to hide internal directories.